Source Code Cross Referenced for CertificatePolicy.java in  » Authentication-Authorization » ejbca » org » ejbca » core » model » ca » certificateprofiles » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Authentication Authorization » ejbca » org.ejbca.core.model.ca.certificateprofiles 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*************************************************************************
002:         *                                                                       *
003:         *  EJBCA: The OpenSource Certificate Authority                          *
004:         *                                                                       *
005:         *  This software is free software; you can redistribute it and/or       *
006:         *  modify it under the terms of the GNU Lesser General Public           *
007:         *  License as published by the Free Software Foundation; either         *
008:         *  version 2.1 of the License, or any later version.                    *
009:         *                                                                       *
010:         *  See terms of license at gnu.org.                                     *
011:         *                                                                       *
012:         *************************************************************************/package org.ejbca.core.model.ca.certificateprofiles;
013:
014:        import java.io.Serializable;
015:
016:        import org.apache.commons.lang.StringUtils;
017:        import org.bouncycastle.asn1.x509.PolicyQualifierId;
018:
019:        /** Class encapsulating the CertificatePolicy X509 certificate extensions. See rfc3280.
020:         * Contains an OID and optionally a policy qualifier. Several CertificatePolicy classes 
021:         * can be created with the same oid, for different qualifiers
022:         * 
023:         * @author Nuno Ponte of MultiCert
024:         * @version $Id: CertificatePolicy.java,v 1.3 2007/11/14 06:05:25 anatom Exp $
025:         */
026:        public class CertificatePolicy implements  Serializable, Cloneable {
027:
028:            /** Warning changing this value will cause upgrades to fail, because
029:             * it has been serialized in the database (in XML).
030:             * DONT CHANGE THIS!
031:             */
032:            private static final long serialVersionUID = -6384137742329979249L;
033:
034:            // Policy qualifier Ids are taken from BC classes
035:            public static final String id_qt_cps = PolicyQualifierId.id_qt_cps
036:                    .getId();
037:            public static final String id_qt_unotice = PolicyQualifierId.id_qt_unotice
038:                    .getId();
039:
040:            /**
041:             * The special <code>anyPolicy</code> policy OID.
042:             */
043:            public static final String ANY_POLICY_OID = "2.5.29.32.0";
044:
045:            private String policyID;
046:            /** CPS uri */
047:            private String qualifierId;
048:            /** user notice text */
049:            private String qualifier;
050:
051:            public CertificatePolicy() {
052:                super ();
053:            }
054:
055:            /**
056:             * 
057:             * @param policyID
058:             * @param notice user notice text
059:             * @param uri cps uri
060:             */
061:            public CertificatePolicy(String policyID, String qualifierId,
062:                    String qualifier) {
063:                this .policyID = policyID;
064:                this .qualifierId = qualifierId;
065:                this .qualifier = qualifier;
066:            }
067:
068:            /**
069:             * @return the policyID
070:             */
071:            public String getPolicyID() {
072:                return this .policyID;
073:            }
074:
075:            /**
076:             * @param policyID the policyID to set
077:             */
078:            public void setPolicyID(String policyID) {
079:                this .policyID = policyID;
080:            }
081:
082:            /**
083:             * @return the qualifier string
084:             */
085:            public String getQualifier() {
086:                return this .qualifier;
087:            }
088:
089:            /**
090:             * @param uri the uri to set
091:             */
092:            public void setQualifier(String qualifier) {
093:                this .qualifier = qualifier;
094:            }
095:
096:            /**
097:             * @return the QualifierId
098:             */
099:            public String getQualifierId() {
100:                return this .qualifierId;
101:            }
102:
103:            /**
104:             * @param qualifierId the QualifierId to set
105:             */
106:            public void setQualifierId(String qualifierId) {
107:                this .qualifierId = qualifierId;
108:            }
109:
110:            /**
111:             * @see java.lang.Object#clone()
112:             */
113:            protected Object clone() {
114:                return new CertificatePolicy(this .policyID, this .qualifierId,
115:                        this .qualifier);
116:            }
117:
118:            /**
119:             * @see java.lang.Object#toString()
120:             */
121:            public String toString() {
122:                StringBuffer strBuffer = new StringBuffer("CertificatePolicy(");
123:
124:                strBuffer.append("policyID=");
125:                strBuffer.append(this .policyID);
126:                strBuffer.append(", qualifierId=");
127:                strBuffer.append(this .qualifierId);
128:                strBuffer.append(", qualifier=");
129:                strBuffer.append(this .qualifier);
130:                strBuffer.append(")");
131:
132:                return strBuffer.toString();
133:            }
134:
135:            /**
136:             * @see java.lang.Object#equals(java.lang.Object)
137:             */
138:            public boolean equals(Object obj) {
139:                if ((obj == null) || !(obj instanceof  CertificatePolicy)) {
140:                    return false;
141:                }
142:                CertificatePolicy policy = (CertificatePolicy) obj;
143:
144:                // We want to let both null and "" be the same value here, i.e. an empty value
145:                // Simply because, especially in gui code, it is somewhat tricky to trust which is a non-existant value
146:                boolean policyeq = false;
147:                if (StringUtils.isEmpty(policy.getPolicyID())
148:                        && StringUtils.isEmpty(this .policyID)) {
149:                    policyeq = true;
150:                } else if (StringUtils.equals(policy.getPolicyID(),
151:                        this .policyID)) {
152:                    policyeq = true;
153:                }
154:                boolean qualifierideq = false;
155:                if (StringUtils.isEmpty(policy.getQualifierId())
156:                        && StringUtils.isEmpty(this .qualifierId)) {
157:                    qualifierideq = true;
158:                } else if (StringUtils.equals(policy.getQualifierId(),
159:                        this .qualifierId)) {
160:                    qualifierideq = true;
161:                }
162:                boolean qualifier = false;
163:                if (StringUtils.isEmpty(policy.getQualifier())
164:                        && StringUtils.isEmpty(this .qualifier)) {
165:                    qualifier = true;
166:                } else if (StringUtils.equals(policy.getQualifier(),
167:                        this .qualifier)) {
168:                    qualifier = true;
169:                }
170:                return policyeq && qualifierideq && qualifier;
171:            }
172:
173:            /**
174:             * @see java.lang.Object#hashCode()
175:             */
176:            public int hashCode() {
177:                return this.toString().hashCode();
178:            }
179:
180:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.