Source Code Cross Referenced for X509LDAPCertStoreParameters.java in  » Security » Bouncy-Castle » org » bouncycastle » jce » 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 » Security » Bouncy Castle » org.bouncycastle.jce 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        package org.bouncycastle.jce;
0002:
0003:        import org.bouncycastle.x509.X509StoreParameters;
0004:
0005:        import java.security.cert.CertStoreParameters;
0006:        import java.security.cert.LDAPCertStoreParameters;
0007:
0008:        /**
0009:         * An expanded set of parameters for an LDAPCertStore
0010:         */
0011:        public class X509LDAPCertStoreParameters implements 
0012:                X509StoreParameters, CertStoreParameters {
0013:
0014:            private String ldapURL;
0015:
0016:            private String baseDN;
0017:
0018:            // LDAP attributes, where data is stored
0019:
0020:            private String userCertificateAttribute;
0021:
0022:            private String cACertificateAttribute;
0023:
0024:            private String crossCertificateAttribute;
0025:
0026:            private String certificateRevocationListAttribute;
0027:
0028:            private String deltaRevocationListAttribute;
0029:
0030:            private String authorityRevocationListAttribute;
0031:
0032:            private String attributeCertificateAttributeAttribute;
0033:
0034:            private String aACertificateAttribute;
0035:
0036:            private String attributeDescriptorCertificateAttribute;
0037:
0038:            private String attributeCertificateRevocationListAttribute;
0039:
0040:            private String attributeAuthorityRevocationListAttribute;
0041:
0042:            // LDAP attributes with which data can be found
0043:
0044:            private String ldapUserCertificateAttributeName;
0045:
0046:            private String ldapCACertificateAttributeName;
0047:
0048:            private String ldapCrossCertificateAttributeName;
0049:
0050:            private String ldapCertificateRevocationListAttributeName;
0051:
0052:            private String ldapDeltaRevocationListAttributeName;
0053:
0054:            private String ldapAuthorityRevocationListAttributeName;
0055:
0056:            private String ldapAttributeCertificateAttributeAttributeName;
0057:
0058:            private String ldapAACertificateAttributeName;
0059:
0060:            private String ldapAttributeDescriptorCertificateAttributeName;
0061:
0062:            private String ldapAttributeCertificateRevocationListAttributeName;
0063:
0064:            private String ldapAttributeAuthorityRevocationListAttributeName;
0065:
0066:            // certificates and CRLs subject or issuer DN attributes, which must be
0067:            // matched against ldap attribute names
0068:
0069:            private String userCertificateSubjectAttributeName;
0070:
0071:            private String cACertificateSubjectAttributeName;
0072:
0073:            private String crossCertificateSubjectAttributeName;
0074:
0075:            private String certificateRevocationListIssuerAttributeName;
0076:
0077:            private String deltaRevocationListIssuerAttributeName;
0078:
0079:            private String authorityRevocationListIssuerAttributeName;
0080:
0081:            private String attributeCertificateAttributeSubjectAttributeName;
0082:
0083:            private String aACertificateSubjectAttributeName;
0084:
0085:            private String attributeDescriptorCertificateSubjectAttributeName;
0086:
0087:            private String attributeCertificateRevocationListIssuerAttributeName;
0088:
0089:            private String attributeAuthorityRevocationListIssuerAttributeName;
0090:
0091:            private String searchForSerialNumberIn;
0092:
0093:            public static class Builder {
0094:                private String ldapURL;
0095:
0096:                private String baseDN;
0097:
0098:                // LDAP attributes, where data is stored
0099:
0100:                private String userCertificateAttribute;
0101:
0102:                private String cACertificateAttribute;
0103:
0104:                private String crossCertificateAttribute;
0105:
0106:                private String certificateRevocationListAttribute;
0107:
0108:                private String deltaRevocationListAttribute;
0109:
0110:                private String authorityRevocationListAttribute;
0111:
0112:                private String attributeCertificateAttributeAttribute;
0113:
0114:                private String aACertificateAttribute;
0115:
0116:                private String attributeDescriptorCertificateAttribute;
0117:
0118:                private String attributeCertificateRevocationListAttribute;
0119:
0120:                private String attributeAuthorityRevocationListAttribute;
0121:
0122:                // LDAP attributes with which data can be found
0123:
0124:                private String ldapUserCertificateAttributeName;
0125:
0126:                private String ldapCACertificateAttributeName;
0127:
0128:                private String ldapCrossCertificateAttributeName;
0129:
0130:                private String ldapCertificateRevocationListAttributeName;
0131:
0132:                private String ldapDeltaRevocationListAttributeName;
0133:
0134:                private String ldapAuthorityRevocationListAttributeName;
0135:
0136:                private String ldapAttributeCertificateAttributeAttributeName;
0137:
0138:                private String ldapAACertificateAttributeName;
0139:
0140:                private String ldapAttributeDescriptorCertificateAttributeName;
0141:
0142:                private String ldapAttributeCertificateRevocationListAttributeName;
0143:
0144:                private String ldapAttributeAuthorityRevocationListAttributeName;
0145:
0146:                // certificates and CRLs subject or issuer DN attributes, which must be
0147:                // matched against ldap attribute names
0148:
0149:                private String userCertificateSubjectAttributeName;
0150:
0151:                private String cACertificateSubjectAttributeName;
0152:
0153:                private String crossCertificateSubjectAttributeName;
0154:
0155:                private String certificateRevocationListIssuerAttributeName;
0156:
0157:                private String deltaRevocationListIssuerAttributeName;
0158:
0159:                private String authorityRevocationListIssuerAttributeName;
0160:
0161:                private String attributeCertificateAttributeSubjectAttributeName;
0162:
0163:                private String aACertificateSubjectAttributeName;
0164:
0165:                private String attributeDescriptorCertificateSubjectAttributeName;
0166:
0167:                private String attributeCertificateRevocationListIssuerAttributeName;
0168:
0169:                private String attributeAuthorityRevocationListIssuerAttributeName;
0170:
0171:                private String searchForSerialNumberIn;
0172:
0173:                public Builder() {
0174:                    this ("ldap://localhost:389", "");
0175:                }
0176:
0177:                public Builder(String ldapURL, String baseDN) {
0178:                    this .ldapURL = ldapURL;
0179:                    if (baseDN == null) {
0180:                        this .baseDN = "";
0181:                    } else {
0182:                        this .baseDN = baseDN;
0183:                    }
0184:
0185:                    this .userCertificateAttribute = "userCertificate";
0186:                    this .cACertificateAttribute = "cACertificate";
0187:                    this .crossCertificateAttribute = "crossCertificatePair";
0188:                    this .certificateRevocationListAttribute = "certificateRevocationList";
0189:                    this .deltaRevocationListAttribute = "deltaRevocationList";
0190:                    this .authorityRevocationListAttribute = "authorityRevocationList";
0191:                    this .attributeCertificateAttributeAttribute = "attributeCertificateAttribute";
0192:                    this .aACertificateAttribute = "aACertificate";
0193:                    this .attributeDescriptorCertificateAttribute = "attributeDescriptorCertificate";
0194:                    this .attributeCertificateRevocationListAttribute = "attributeCertificateRevocationList";
0195:                    this .attributeAuthorityRevocationListAttribute = "attributeAuthorityRevocationList";
0196:                    this .ldapUserCertificateAttributeName = "cn";
0197:                    this .ldapCACertificateAttributeName = "cn ou o";
0198:                    this .ldapCrossCertificateAttributeName = "cn ou o";
0199:                    this .ldapCertificateRevocationListAttributeName = "cn ou o";
0200:                    this .ldapDeltaRevocationListAttributeName = "cn ou o";
0201:                    this .ldapAuthorityRevocationListAttributeName = "cn ou o";
0202:                    this .ldapAttributeCertificateAttributeAttributeName = "cn";
0203:                    this .ldapAACertificateAttributeName = "cn o ou";
0204:                    this .ldapAttributeDescriptorCertificateAttributeName = "cn o ou";
0205:                    this .ldapAttributeCertificateRevocationListAttributeName = "cn o ou";
0206:                    this .ldapAttributeAuthorityRevocationListAttributeName = "cn o ou";
0207:                    this .userCertificateSubjectAttributeName = "cn";
0208:                    this .cACertificateSubjectAttributeName = "o ou";
0209:                    this .crossCertificateSubjectAttributeName = "o ou";
0210:                    this .certificateRevocationListIssuerAttributeName = "o ou";
0211:                    this .deltaRevocationListIssuerAttributeName = "o ou";
0212:                    this .authorityRevocationListIssuerAttributeName = "o ou";
0213:                    this .attributeCertificateAttributeSubjectAttributeName = "cn";
0214:                    this .aACertificateSubjectAttributeName = "o ou";
0215:                    this .attributeDescriptorCertificateSubjectAttributeName = "o ou";
0216:                    this .attributeCertificateRevocationListIssuerAttributeName = "o ou";
0217:                    this .attributeAuthorityRevocationListIssuerAttributeName = "o ou";
0218:                    this .searchForSerialNumberIn = "uid serialNumber cn";
0219:                }
0220:
0221:                /**
0222:                 * @param userCertificateAttribute       Attribute name(s) in the LDAP directory where end certificates
0223:                 *                                       are stored. Separated by space. Defaults to "userCertificate"
0224:                 *                                       if <code>null</code>.
0225:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0226:                 * @return the builder
0227:                 */
0228:                public Builder setUserCertificateAttribute(
0229:                        String userCertificateAttribute) {
0230:                    this .userCertificateAttribute = userCertificateAttribute;
0231:
0232:                    return this ;
0233:                }
0234:
0235:                /**
0236:                 * @param cACertificateAttribute         Attribute name(s) in the LDAP directory where CA certificates
0237:                 *                                       are stored. Separated by space. Defaults to "cACertificate" if
0238:                 *                                       <code>null</code>.
0239:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0240:                 * @return the builder
0241:                 */
0242:                public Builder setCACertificateAttribute(
0243:                        String cACertificateAttribute) {
0244:                    this .cACertificateAttribute = cACertificateAttribute;
0245:
0246:                    return this ;
0247:                }
0248:
0249:                /**
0250:                 * @param crossCertificateAttribute      Attribute name(s), where the cross certificates are stored.
0251:                 *                                       Separated by space. Defaults to "crossCertificatePair" if
0252:                 *                                       <code>null</code>
0253:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0254:                 * @return the builder
0255:                 */
0256:                public Builder setCrossCertificateAttribute(
0257:                        String crossCertificateAttribute) {
0258:                    this .crossCertificateAttribute = crossCertificateAttribute;
0259:
0260:                    return this ;
0261:                }
0262:
0263:                /**
0264:                 * @param certificateRevocationListAttribute
0265:                 *                                       Attribute name(s) in the LDAP directory where CRLs are stored.
0266:                 *                                       Separated by space. Defaults to "certificateRevocationList" if
0267:                 *                                       <code>null</code>.
0268:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0269:                 * @return the builder
0270:                 */
0271:                public Builder setCertificateRevocationListAttribute(
0272:                        String certificateRevocationListAttribute) {
0273:                    this .certificateRevocationListAttribute = certificateRevocationListAttribute;
0274:
0275:                    return this ;
0276:                }
0277:
0278:                /**
0279:                 * @param deltaRevocationListAttribute   Attribute name(s) in the LDAP directory where delta RLs are
0280:                 *                                       stored. Separated by space. Defaults to "deltaRevocationList"
0281:                 *                                       if <code>null</code>.
0282:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0283:                 * @return the builder
0284:                 */
0285:                public Builder setDeltaRevocationListAttribute(
0286:                        String deltaRevocationListAttribute) {
0287:                    this .deltaRevocationListAttribute = deltaRevocationListAttribute;
0288:
0289:                    return this ;
0290:                }
0291:
0292:                /**
0293:                 * @param authorityRevocationListAttribute
0294:                 *                                       Attribute name(s) in the LDAP directory where CRLs for
0295:                 *                                       authorities are stored. Separated by space. Defaults to
0296:                 *                                       "authorityRevocationList" if <code>null</code>.
0297:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0298:                 * @return the builder
0299:                 */
0300:                public Builder setAuthorityRevocationListAttribute(
0301:                        String authorityRevocationListAttribute) {
0302:                    this .authorityRevocationListAttribute = authorityRevocationListAttribute;
0303:
0304:                    return this ;
0305:                }
0306:
0307:                /**
0308:                 * @param attributeCertificateAttributeAttribute
0309:                 *                                       Attribute name(s) in the LDAP directory where end attribute
0310:                 *                                       certificates are stored. Separated by space. Defaults to
0311:                 *                                       "attributeCertificateAttribute" if <code>null</code>.
0312:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0313:                 * @return the builder
0314:                 */
0315:                public Builder setAttributeCertificateAttributeAttribute(
0316:                        String attributeCertificateAttributeAttribute) {
0317:                    this .attributeCertificateAttributeAttribute = attributeCertificateAttributeAttribute;
0318:
0319:                    return this ;
0320:                }
0321:
0322:                /**
0323:                 * @param aACertificateAttribute         Attribute name(s) in the LDAP directory where attribute
0324:                 *                                       certificates for attribute authorities are stored. Separated
0325:                 *                                       by space. Defaults to "aACertificate" if <code>null</code>.
0326:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0327:                 * @return the builder
0328:                 */
0329:                public Builder setAACertificateAttribute(
0330:                        String aACertificateAttribute) {
0331:                    this .aACertificateAttribute = aACertificateAttribute;
0332:
0333:                    return this ;
0334:                }
0335:
0336:                /**
0337:                 * @param attributeDescriptorCertificateAttribute
0338:                 *                                       Attribute name(s) in the LDAP directory where self signed
0339:                 *                                       attribute certificates for attribute authorities are stored.
0340:                 *                                       Separated by space. Defaults to
0341:                 *                                       "attributeDescriptorCertificate" if <code>null</code>.
0342:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0343:                 * @return the builder
0344:                 */
0345:                public Builder setAttributeDescriptorCertificateAttribute(
0346:                        String attributeDescriptorCertificateAttribute) {
0347:                    this .attributeDescriptorCertificateAttribute = attributeDescriptorCertificateAttribute;
0348:
0349:                    return this ;
0350:                }
0351:
0352:                /**
0353:                 * @param attributeCertificateRevocationListAttribute
0354:                 *                                       Attribute name(s) in the LDAP directory where CRLs for
0355:                 *                                       attribute certificates are stored. Separated by space.
0356:                 *                                       Defaults to "attributeCertificateRevocationList" if
0357:                 *                                       <code>null</code>.
0358:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0359:                 * @return the builder
0360:                 */
0361:                public Builder setAttributeCertificateRevocationListAttribute(
0362:                        String attributeCertificateRevocationListAttribute) {
0363:                    this .attributeCertificateRevocationListAttribute = attributeCertificateRevocationListAttribute;
0364:
0365:                    return this ;
0366:                }
0367:
0368:                /**
0369:                 * @param attributeAuthorityRevocationListAttribute
0370:                 *                                       Attribute name(s) in the LDAP directory where RLs for
0371:                 *                                       attribute authority attribute certificates are stored.
0372:                 *                                       Separated by space. Defaults to
0373:                 *                                       "attributeAuthorityRevocationList" if <code>null</code>.
0374:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0375:                 * @return the builder
0376:                 */
0377:                public Builder setAttributeAuthorityRevocationListAttribute(
0378:                        String attributeAuthorityRevocationListAttribute) {
0379:                    this .attributeAuthorityRevocationListAttribute = attributeAuthorityRevocationListAttribute;
0380:
0381:                    return this ;
0382:                }
0383:
0384:                /**
0385:                 * @param ldapUserCertificateAttributeName
0386:                 *                                       The attribute name(s) in the LDAP directory where to search
0387:                 *                                       for the attribute value of the specified
0388:                 *                                       <code>userCertificateSubjectAttributeName</code>. E.g. if
0389:                 *                                       "cn" is used to put information about the subject for end
0390:                 *                                       certificates, then specify "cn".
0391:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0392:                 * @return the builder
0393:                 */
0394:                public Builder setLdapUserCertificateAttributeName(
0395:                        String ldapUserCertificateAttributeName) {
0396:                    this .ldapUserCertificateAttributeName = ldapUserCertificateAttributeName;
0397:
0398:                    return this ;
0399:                }
0400:
0401:                /**
0402:                 * @param ldapCACertificateAttributeName The attribute name(s) in the LDAP directory where to search
0403:                 *                                       for the attribute value of the specified
0404:                 *                                       <code>cACertificateSubjectAttributeName</code>. E.g. if
0405:                 *                                       "ou" is used to put information about the subject for CA
0406:                 *                                       certificates, then specify "ou".
0407:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0408:                 * @return the builder
0409:                 */
0410:                public Builder setLdapCACertificateAttributeName(
0411:                        String ldapCACertificateAttributeName) {
0412:                    this .ldapCACertificateAttributeName = ldapCACertificateAttributeName;
0413:
0414:                    return this ;
0415:                }
0416:
0417:                /**
0418:                 * @param ldapCrossCertificateAttributeName
0419:                 *                                       The attribute name(s) in the LDAP directory where to search for
0420:                 *                                       the attribute value of the specified
0421:                 *                                       <code>crossCertificateSubjectAttributeName</code>. E.g. if
0422:                 *                                       "o" is used to put information about the subject for cross
0423:                 *                                       certificates, then specify "o".
0424:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0425:                 * @return the builder
0426:                 */
0427:                public Builder setLdapCrossCertificateAttributeName(
0428:                        String ldapCrossCertificateAttributeName) {
0429:                    this .ldapCrossCertificateAttributeName = ldapCrossCertificateAttributeName;
0430:
0431:                    return this ;
0432:                }
0433:
0434:                /**
0435:                 * @param ldapCertificateRevocationListAttributeName
0436:                 *                                       The attribute name(s) in the LDAP directory where to search for
0437:                 *                                       the attribute value of the specified
0438:                 *                                       <code>certificateRevocationListIssuerAttributeName</code>.
0439:                 *                                       E.g. if "ou" is used to put information about the issuer of
0440:                 *                                       CRLs, specify "ou".
0441:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0442:                 * @return the builder
0443:                 */
0444:                public Builder setLdapCertificateRevocationListAttributeName(
0445:                        String ldapCertificateRevocationListAttributeName) {
0446:                    this .ldapCertificateRevocationListAttributeName = ldapCertificateRevocationListAttributeName;
0447:
0448:                    return this ;
0449:                }
0450:
0451:                /**
0452:                 * @param ldapDeltaRevocationListAttributeName
0453:                 *                                       The attribute name(s) in the LDAP directory where to search for
0454:                 *                                       the attribute value of the specified
0455:                 *                                       <code>deltaRevocationListIssuerAttributeName</code>. E.g.
0456:                 *                                       if "ou" is used to put information about the issuer of CRLs,
0457:                 *                                       specify "ou".
0458:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0459:                 * @return the builder
0460:                 */
0461:                public Builder setLdapDeltaRevocationListAttributeName(
0462:                        String ldapDeltaRevocationListAttributeName) {
0463:                    this .ldapDeltaRevocationListAttributeName = ldapDeltaRevocationListAttributeName;
0464:
0465:                    return this ;
0466:                }
0467:
0468:                /**
0469:                 * @param ldapAuthorityRevocationListAttributeName
0470:                 *                                       The attribute name(s) in the LDAP directory where to search for
0471:                 *                                       the attribute value of the specified
0472:                 *                                       <code>authorityRevocationListIssuerAttributeName</code>.
0473:                 *                                       E.g. if "ou" is used to put information about the issuer of
0474:                 *                                       CRLs, specify "ou".
0475:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0476:                 * @return the builder
0477:                 */
0478:                public Builder setLdapAuthorityRevocationListAttributeName(
0479:                        String ldapAuthorityRevocationListAttributeName) {
0480:                    this .ldapAuthorityRevocationListAttributeName = ldapAuthorityRevocationListAttributeName;
0481:
0482:                    return this ;
0483:                }
0484:
0485:                /**
0486:                 * @param ldapAttributeCertificateAttributeAttributeName
0487:                 *                                       The attribute name(s) in the LDAP directory where to search for
0488:                 *                                       the attribute value of the specified
0489:                 *                                       <code>attributeCertificateAttributeSubjectAttributeName</code>.
0490:                 *                                       E.g. if "cn" is used to put information about the subject of
0491:                 *                                       end attribute certificates, specify "cn".
0492:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0493:                 * @return the builder
0494:                 */
0495:                public Builder setLdapAttributeCertificateAttributeAttributeName(
0496:                        String ldapAttributeCertificateAttributeAttributeName) {
0497:                    this .ldapAttributeCertificateAttributeAttributeName = ldapAttributeCertificateAttributeAttributeName;
0498:
0499:                    return this ;
0500:                }
0501:
0502:                /**
0503:                 * @param ldapAACertificateAttributeName The attribute name(s) in the LDAP directory where to search for
0504:                 *                                       the attribute value of the specified
0505:                 *                                       <code>aACertificateSubjectAttributeName</code>. E.g. if
0506:                 *                                       "ou" is used to put information about the subject of attribute
0507:                 *                                       authority attribute certificates, specify "ou".
0508:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0509:                 * @return the builder
0510:                 */
0511:                public Builder setLdapAACertificateAttributeName(
0512:                        String ldapAACertificateAttributeName) {
0513:                    this .ldapAACertificateAttributeName = ldapAACertificateAttributeName;
0514:
0515:                    return this ;
0516:                }
0517:
0518:                /**
0519:                 * @param ldapAttributeDescriptorCertificateAttributeName
0520:                 *                                       The attribute name(s) in the LDAP directory where to search for
0521:                 *                                       the attribute value of the specified
0522:                 *                                       <code>attributeDescriptorCertificateSubjectAttributeName</code>.
0523:                 *                                       E.g. if "o" is used to put information about the subject of
0524:                 *                                       self signed attribute authority attribute certificates,
0525:                 *                                       specify "o".
0526:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0527:                 * @return the builder
0528:                 */
0529:                public Builder setLdapAttributeDescriptorCertificateAttributeName(
0530:                        String ldapAttributeDescriptorCertificateAttributeName) {
0531:                    this .ldapAttributeDescriptorCertificateAttributeName = ldapAttributeDescriptorCertificateAttributeName;
0532:
0533:                    return this ;
0534:                }
0535:
0536:                /**
0537:                 * @param ldapAttributeCertificateRevocationListAttributeName
0538:                 *                                       The attribute name(s) in the LDAP directory where to search for
0539:                 *                                       the attribute value of the specified
0540:                 *                                       <code>attributeCertificateRevocationListIssuerAttributeName</code>.
0541:                 *                                       E.g. if "ou" is used to put information about the issuer of
0542:                 *                                       CRLs, specify "ou".
0543:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0544:                 * @return the builder
0545:                 */
0546:                public Builder setLdapAttributeCertificateRevocationListAttributeName(
0547:                        String ldapAttributeCertificateRevocationListAttributeName) {
0548:                    this .ldapAttributeCertificateRevocationListAttributeName = ldapAttributeCertificateRevocationListAttributeName;
0549:
0550:                    return this ;
0551:                }
0552:
0553:                /**
0554:                 * @param ldapAttributeAuthorityRevocationListAttributeName
0555:                 *                                       The attribute name(s) in the LDAP directory where to search for
0556:                 *                                       the attribute value of the specified
0557:                 *                                       <code>attributeAuthorityRevocationListIssuerAttributeName</code>.
0558:                 *                                       E.g. if "ou" is used to put information about the issuer of
0559:                 *                                       CRLs, specify "ou".
0560:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0561:                 * @return the builder
0562:                 */
0563:                public Builder setLdapAttributeAuthorityRevocationListAttributeName(
0564:                        String ldapAttributeAuthorityRevocationListAttributeName) {
0565:                    this .ldapAttributeAuthorityRevocationListAttributeName = ldapAttributeAuthorityRevocationListAttributeName;
0566:
0567:                    return this ;
0568:                }
0569:
0570:                /**
0571:                 * @param userCertificateSubjectAttributeName
0572:                 *                                       Attribute(s) in the subject of the certificate which is used
0573:                 *                                       to be searched in the
0574:                 *                                       <code>ldapUserCertificateAttributeName</code>. E.g. the
0575:                 *                                       "cn" attribute of the DN could be used.
0576:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0577:                 * @return the builder
0578:                 */
0579:                public Builder setUserCertificateSubjectAttributeName(
0580:                        String userCertificateSubjectAttributeName) {
0581:                    this .userCertificateSubjectAttributeName = userCertificateSubjectAttributeName;
0582:
0583:                    return this ;
0584:                }
0585:
0586:                /**
0587:                 * @param cACertificateSubjectAttributeName
0588:                 *                                       Attribute(s) in the subject of the certificate which is used
0589:                 *                                       to be searched in the
0590:                 *                                       <code>ldapCACertificateAttributeName</code>. E.g. the "ou"
0591:                 *                                       attribute of the DN could be used.
0592:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0593:                 * @return the builder
0594:                 */
0595:                public Builder setCACertificateSubjectAttributeName(
0596:                        String cACertificateSubjectAttributeName) {
0597:                    this .cACertificateSubjectAttributeName = cACertificateSubjectAttributeName;
0598:
0599:                    return this ;
0600:                }
0601:
0602:                /**
0603:                 * @param crossCertificateSubjectAttributeName
0604:                 *                                       Attribute(s) in the subject of the cross certificate which is
0605:                 *                                       used to be searched in the
0606:                 *                                       <code>ldapCrossCertificateAttributeName</code>. E.g. the
0607:                 *                                       "o" attribute of the DN may be appropriate.
0608:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0609:                 * @return the builder
0610:                 */
0611:                public Builder setCrossCertificateSubjectAttributeName(
0612:                        String crossCertificateSubjectAttributeName) {
0613:                    this .crossCertificateSubjectAttributeName = crossCertificateSubjectAttributeName;
0614:
0615:                    return this ;
0616:                }
0617:
0618:                /**
0619:                 * @param certificateRevocationListIssuerAttributeName
0620:                 *                                       Attribute(s) in the issuer of the CRL which is used to be
0621:                 *                                       searched in the
0622:                 *                                       <code>ldapCertificateRevocationListAttributeName</code>.
0623:                 *                                       E.g. the "o" or "ou" attribute may be used.
0624:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0625:                 * @return the builder
0626:                 */
0627:                public Builder setCertificateRevocationListIssuerAttributeName(
0628:                        String certificateRevocationListIssuerAttributeName) {
0629:                    this .certificateRevocationListIssuerAttributeName = certificateRevocationListIssuerAttributeName;
0630:
0631:                    return this ;
0632:                }
0633:
0634:                /**
0635:                 * @param deltaRevocationListIssuerAttributeName
0636:                 *                                       Attribute(s) in the issuer of the CRL which is used to be
0637:                 *                                       searched in the
0638:                 *                                       <code>ldapDeltaRevocationListAttributeName</code>. E.g. the
0639:                 *                                       "o" or "ou" attribute may be used.
0640:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0641:                 * @return the builder
0642:                 */
0643:                public Builder setDeltaRevocationListIssuerAttributeName(
0644:                        String deltaRevocationListIssuerAttributeName) {
0645:                    this .deltaRevocationListIssuerAttributeName = deltaRevocationListIssuerAttributeName;
0646:
0647:                    return this ;
0648:                }
0649:
0650:                /**
0651:                 * @param authorityRevocationListIssuerAttributeName
0652:                 *                                       Attribute(s) in the issuer of the CRL which is used to be
0653:                 *                                       searched in the
0654:                 *                                       <code>ldapAuthorityRevocationListAttributeName</code>. E.g.
0655:                 *                                       the "o" or "ou" attribute may be used.
0656:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0657:                 * @return the builder
0658:                 */
0659:                public Builder setAuthorityRevocationListIssuerAttributeName(
0660:                        String authorityRevocationListIssuerAttributeName) {
0661:                    this .authorityRevocationListIssuerAttributeName = authorityRevocationListIssuerAttributeName;
0662:
0663:                    return this ;
0664:                }
0665:
0666:                /**
0667:                 * @param attributeCertificateAttributeSubjectAttributeName
0668:                 *                                       Attribute(s) in the subject of the attribute certificate which
0669:                 *                                       is used to be searched in the
0670:                 *                                       <code>ldapAttributeCertificateAttributeAttributeName</code>.
0671:                 *                                       E.g. the "cn" attribute of the DN could be used.
0672:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0673:                 * @return the builder
0674:                 */
0675:                public Builder setAttributeCertificateAttributeSubjectAttributeName(
0676:                        String attributeCertificateAttributeSubjectAttributeName) {
0677:                    this .attributeCertificateAttributeSubjectAttributeName = attributeCertificateAttributeSubjectAttributeName;
0678:
0679:                    return this ;
0680:                }
0681:
0682:                /**
0683:                 * @param aACertificateSubjectAttributeName
0684:                 *                                       Attribute(s) in the subject of the attribute certificate which
0685:                 *                                       is used to be searched in the
0686:                 *                                       <code>ldapAACertificateAttributeName</code>. E.g. the "ou"
0687:                 *                                       attribute of the DN could be used.
0688:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0689:                 * @return the builder
0690:                 */
0691:                public Builder setAACertificateSubjectAttributeName(
0692:                        String aACertificateSubjectAttributeName) {
0693:                    this .aACertificateSubjectAttributeName = aACertificateSubjectAttributeName;
0694:
0695:                    return this ;
0696:                }
0697:
0698:                /**
0699:                 * @param attributeDescriptorCertificateSubjectAttributeName
0700:                 *                                       Attribute(s) in the subject of the attribute certificate which
0701:                 *                                       is used to be searched in the
0702:                 *                                       <code>ldapAttributeDescriptorCertificateAttributeName</code>.
0703:                 *                                       E.g. the "o" attribute of the DN could be used.
0704:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0705:                 * @return the builder
0706:                 */
0707:                public Builder setAttributeDescriptorCertificateSubjectAttributeName(
0708:                        String attributeDescriptorCertificateSubjectAttributeName) {
0709:                    this .attributeDescriptorCertificateSubjectAttributeName = attributeDescriptorCertificateSubjectAttributeName;
0710:
0711:                    return this ;
0712:                }
0713:
0714:                /**
0715:                 * @param attributeCertificateRevocationListIssuerAttributeName
0716:                 *                                       Attribute(s) in the issuer of the CRL which is used to be
0717:                 *                                       searched in the
0718:                 *                                       <code>ldapAttributeCertificateRevocationListAttributeName</code>.
0719:                 *                                       E.g. the "o" or "ou" attribute may be used
0720:                 *                                       certificate is searched in this LDAP attribute.
0721:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0722:                 * @return the builder
0723:                 */
0724:                public Builder setAttributeCertificateRevocationListIssuerAttributeName(
0725:                        String attributeCertificateRevocationListIssuerAttributeName) {
0726:                    this .attributeCertificateRevocationListIssuerAttributeName = attributeCertificateRevocationListIssuerAttributeName;
0727:
0728:                    return this ;
0729:                }
0730:
0731:                /**
0732:                 * @param attributeAuthorityRevocationListIssuerAttributeName
0733:                 *                                       Anttribute(s) in the issuer of the CRL which is used to be
0734:                 *                                       searched in the
0735:                 *                                       <code>ldapAttributeAuthorityRevocationListAttributeName</code>.
0736:                 *                                       E.g. the "o" or "ou" attribute may be used.
0737:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0738:                 * @return the builder
0739:                 */
0740:                public Builder setAttributeAuthorityRevocationListIssuerAttributeName(
0741:                        String attributeAuthorityRevocationListIssuerAttributeName) {
0742:                    this .attributeAuthorityRevocationListIssuerAttributeName = attributeAuthorityRevocationListIssuerAttributeName;
0743:
0744:                    return this ;
0745:                }
0746:
0747:                /**
0748:                 *
0749:                 * @param searchForSerialNumberIn        If not <code>null</code> the serial number of the
0750:                 *                                       certificate is searched in this LDAP attribute.
0751:                 * @throws IllegalArgumentException if a necessary parameter is <code>null</code>.
0752:                 * @return the builder
0753:                 */
0754:                public Builder setSearchForSerialNumberIn(
0755:                        String searchForSerialNumberIn) {
0756:                    this .searchForSerialNumberIn = searchForSerialNumberIn;
0757:
0758:                    return this ;
0759:                }
0760:
0761:                public X509LDAPCertStoreParameters build() {
0762:                    if (ldapUserCertificateAttributeName == null // migrate to setters
0763:                            || ldapCACertificateAttributeName == null
0764:                            || ldapCrossCertificateAttributeName == null
0765:                            || ldapCertificateRevocationListAttributeName == null
0766:                            || ldapDeltaRevocationListAttributeName == null
0767:                            || ldapAuthorityRevocationListAttributeName == null
0768:                            || ldapAttributeCertificateAttributeAttributeName == null
0769:                            || ldapAACertificateAttributeName == null
0770:                            || ldapAttributeDescriptorCertificateAttributeName == null
0771:                            || ldapAttributeCertificateRevocationListAttributeName == null
0772:                            || ldapAttributeAuthorityRevocationListAttributeName == null
0773:                            || userCertificateSubjectAttributeName == null
0774:                            || cACertificateSubjectAttributeName == null
0775:                            || crossCertificateSubjectAttributeName == null
0776:                            || certificateRevocationListIssuerAttributeName == null
0777:                            || deltaRevocationListIssuerAttributeName == null
0778:                            || authorityRevocationListIssuerAttributeName == null
0779:                            || attributeCertificateAttributeSubjectAttributeName == null
0780:                            || aACertificateSubjectAttributeName == null
0781:                            || attributeDescriptorCertificateSubjectAttributeName == null
0782:                            || attributeCertificateRevocationListIssuerAttributeName == null
0783:                            || attributeAuthorityRevocationListIssuerAttributeName == null) {
0784:                        throw new IllegalArgumentException(
0785:                                "Necessary parameters not specified.");
0786:                    }
0787:                    return new X509LDAPCertStoreParameters(this );
0788:                }
0789:            }
0790:
0791:            private X509LDAPCertStoreParameters(Builder builder) {
0792:                this .ldapURL = builder.ldapURL;
0793:                this .baseDN = builder.baseDN;
0794:
0795:                this .userCertificateAttribute = builder.userCertificateAttribute;
0796:                this .cACertificateAttribute = builder.cACertificateAttribute;
0797:                this .crossCertificateAttribute = builder.crossCertificateAttribute;
0798:                this .certificateRevocationListAttribute = builder.certificateRevocationListAttribute;
0799:                this .deltaRevocationListAttribute = builder.deltaRevocationListAttribute;
0800:                this .authorityRevocationListAttribute = builder.authorityRevocationListAttribute;
0801:                this .attributeCertificateAttributeAttribute = builder.attributeCertificateAttributeAttribute;
0802:                this .aACertificateAttribute = builder.aACertificateAttribute;
0803:                this .attributeDescriptorCertificateAttribute = builder.attributeDescriptorCertificateAttribute;
0804:                this .attributeCertificateRevocationListAttribute = builder.attributeCertificateRevocationListAttribute;
0805:                this .attributeAuthorityRevocationListAttribute = builder.attributeAuthorityRevocationListAttribute;
0806:                this .ldapUserCertificateAttributeName = builder.ldapUserCertificateAttributeName;
0807:                this .ldapCACertificateAttributeName = builder.ldapCACertificateAttributeName;
0808:                this .ldapCrossCertificateAttributeName = builder.ldapCrossCertificateAttributeName;
0809:                this .ldapCertificateRevocationListAttributeName = builder.ldapCertificateRevocationListAttributeName;
0810:                this .ldapDeltaRevocationListAttributeName = builder.ldapDeltaRevocationListAttributeName;
0811:                this .ldapAuthorityRevocationListAttributeName = builder.ldapAuthorityRevocationListAttributeName;
0812:                this .ldapAttributeCertificateAttributeAttributeName = builder.ldapAttributeCertificateAttributeAttributeName;
0813:                this .ldapAACertificateAttributeName = builder.ldapAACertificateAttributeName;
0814:                this .ldapAttributeDescriptorCertificateAttributeName = builder.ldapAttributeDescriptorCertificateAttributeName;
0815:                this .ldapAttributeCertificateRevocationListAttributeName = builder.ldapAttributeCertificateRevocationListAttributeName;
0816:                this .ldapAttributeAuthorityRevocationListAttributeName = builder.ldapAttributeAuthorityRevocationListAttributeName;
0817:                this .userCertificateSubjectAttributeName = builder.userCertificateSubjectAttributeName;
0818:                this .cACertificateSubjectAttributeName = builder.cACertificateSubjectAttributeName;
0819:                this .crossCertificateSubjectAttributeName = builder.crossCertificateSubjectAttributeName;
0820:                this .certificateRevocationListIssuerAttributeName = builder.certificateRevocationListIssuerAttributeName;
0821:                this .deltaRevocationListIssuerAttributeName = builder.deltaRevocationListIssuerAttributeName;
0822:                this .authorityRevocationListIssuerAttributeName = builder.authorityRevocationListIssuerAttributeName;
0823:                this .attributeCertificateAttributeSubjectAttributeName = builder.attributeCertificateAttributeSubjectAttributeName;
0824:                this .aACertificateSubjectAttributeName = builder.aACertificateSubjectAttributeName;
0825:                this .attributeDescriptorCertificateSubjectAttributeName = builder.attributeDescriptorCertificateSubjectAttributeName;
0826:                this .attributeCertificateRevocationListIssuerAttributeName = builder.attributeCertificateRevocationListIssuerAttributeName;
0827:                this .attributeAuthorityRevocationListIssuerAttributeName = builder.attributeAuthorityRevocationListIssuerAttributeName;
0828:                this .searchForSerialNumberIn = builder.searchForSerialNumberIn;
0829:            }
0830:
0831:            /**
0832:             * Returns a clone of this object.
0833:             */
0834:            public Object clone() {
0835:                return this ;
0836:            }
0837:
0838:            public boolean equal(Object o) {
0839:                if (o == this ) {
0840:                    return true;
0841:                }
0842:
0843:                if (!(o instanceof  X509LDAPCertStoreParameters)) {
0844:                    return false;
0845:                }
0846:
0847:                X509LDAPCertStoreParameters params = (X509LDAPCertStoreParameters) o;
0848:                return checkField(ldapURL, params.ldapURL)
0849:                        && checkField(baseDN, params.baseDN)
0850:                        && checkField(userCertificateAttribute,
0851:                                params.userCertificateAttribute)
0852:                        && checkField(cACertificateAttribute,
0853:                                params.cACertificateAttribute)
0854:                        && checkField(crossCertificateAttribute,
0855:                                params.crossCertificateAttribute)
0856:                        && checkField(certificateRevocationListAttribute,
0857:                                params.certificateRevocationListAttribute)
0858:                        && checkField(deltaRevocationListAttribute,
0859:                                params.deltaRevocationListAttribute)
0860:                        && checkField(authorityRevocationListAttribute,
0861:                                params.authorityRevocationListAttribute)
0862:                        && checkField(attributeCertificateAttributeAttribute,
0863:                                params.attributeCertificateAttributeAttribute)
0864:                        && checkField(aACertificateAttribute,
0865:                                params.aACertificateAttribute)
0866:                        && checkField(attributeDescriptorCertificateAttribute,
0867:                                params.attributeDescriptorCertificateAttribute)
0868:                        && checkField(
0869:                                attributeCertificateRevocationListAttribute,
0870:                                params.attributeCertificateRevocationListAttribute)
0871:                        && checkField(
0872:                                attributeAuthorityRevocationListAttribute,
0873:                                params.attributeAuthorityRevocationListAttribute)
0874:                        && checkField(ldapUserCertificateAttributeName,
0875:                                params.ldapUserCertificateAttributeName)
0876:                        && checkField(ldapCACertificateAttributeName,
0877:                                params.ldapCACertificateAttributeName)
0878:                        && checkField(ldapCrossCertificateAttributeName,
0879:                                params.ldapCrossCertificateAttributeName)
0880:                        && checkField(
0881:                                ldapCertificateRevocationListAttributeName,
0882:                                params.ldapCertificateRevocationListAttributeName)
0883:                        && checkField(ldapDeltaRevocationListAttributeName,
0884:                                params.ldapDeltaRevocationListAttributeName)
0885:                        && checkField(ldapAuthorityRevocationListAttributeName,
0886:                                params.ldapAuthorityRevocationListAttributeName)
0887:                        && checkField(
0888:                                ldapAttributeCertificateAttributeAttributeName,
0889:                                params.ldapAttributeCertificateAttributeAttributeName)
0890:                        && checkField(ldapAACertificateAttributeName,
0891:                                params.ldapAACertificateAttributeName)
0892:                        && checkField(
0893:                                ldapAttributeDescriptorCertificateAttributeName,
0894:                                params.ldapAttributeDescriptorCertificateAttributeName)
0895:                        && checkField(
0896:                                ldapAttributeCertificateRevocationListAttributeName,
0897:                                params.ldapAttributeCertificateRevocationListAttributeName)
0898:                        && checkField(
0899:                                ldapAttributeAuthorityRevocationListAttributeName,
0900:                                params.ldapAttributeAuthorityRevocationListAttributeName)
0901:                        && checkField(userCertificateSubjectAttributeName,
0902:                                params.userCertificateSubjectAttributeName)
0903:                        && checkField(cACertificateSubjectAttributeName,
0904:                                params.cACertificateSubjectAttributeName)
0905:                        && checkField(crossCertificateSubjectAttributeName,
0906:                                params.crossCertificateSubjectAttributeName)
0907:                        && checkField(
0908:                                certificateRevocationListIssuerAttributeName,
0909:                                params.certificateRevocationListIssuerAttributeName)
0910:                        && checkField(deltaRevocationListIssuerAttributeName,
0911:                                params.deltaRevocationListIssuerAttributeName)
0912:                        && checkField(
0913:                                authorityRevocationListIssuerAttributeName,
0914:                                params.authorityRevocationListIssuerAttributeName)
0915:                        && checkField(
0916:                                attributeCertificateAttributeSubjectAttributeName,
0917:                                params.attributeCertificateAttributeSubjectAttributeName)
0918:                        && checkField(aACertificateSubjectAttributeName,
0919:                                params.aACertificateSubjectAttributeName)
0920:                        && checkField(
0921:                                attributeDescriptorCertificateSubjectAttributeName,
0922:                                params.attributeDescriptorCertificateSubjectAttributeName)
0923:                        && checkField(
0924:                                attributeCertificateRevocationListIssuerAttributeName,
0925:                                params.attributeCertificateRevocationListIssuerAttributeName)
0926:                        && checkField(
0927:                                attributeAuthorityRevocationListIssuerAttributeName,
0928:                                params.attributeAuthorityRevocationListIssuerAttributeName)
0929:                        && checkField(searchForSerialNumberIn,
0930:                                params.searchForSerialNumberIn);
0931:            }
0932:
0933:            private boolean checkField(Object o1, Object o2) {
0934:                if (o1 == o2) {
0935:                    return true;
0936:                }
0937:
0938:                if (o1 == null) {
0939:                    return false;
0940:                }
0941:
0942:                return o1.equals(o2);
0943:            }
0944:
0945:            public int hashCode() {
0946:                int hash = 0;
0947:
0948:                hash = addHashCode(hash, userCertificateAttribute);
0949:                hash = addHashCode(hash, cACertificateAttribute);
0950:                hash = addHashCode(hash, crossCertificateAttribute);
0951:                hash = addHashCode(hash, certificateRevocationListAttribute);
0952:                hash = addHashCode(hash, deltaRevocationListAttribute);
0953:                hash = addHashCode(hash, authorityRevocationListAttribute);
0954:                hash = addHashCode(hash, attributeCertificateAttributeAttribute);
0955:                hash = addHashCode(hash, aACertificateAttribute);
0956:                hash = addHashCode(hash,
0957:                        attributeDescriptorCertificateAttribute);
0958:                hash = addHashCode(hash,
0959:                        attributeCertificateRevocationListAttribute);
0960:                hash = addHashCode(hash,
0961:                        attributeAuthorityRevocationListAttribute);
0962:                hash = addHashCode(hash, ldapUserCertificateAttributeName);
0963:                hash = addHashCode(hash, ldapCACertificateAttributeName);
0964:                hash = addHashCode(hash, ldapCrossCertificateAttributeName);
0965:                hash = addHashCode(hash,
0966:                        ldapCertificateRevocationListAttributeName);
0967:                hash = addHashCode(hash, ldapDeltaRevocationListAttributeName);
0968:                hash = addHashCode(hash,
0969:                        ldapAuthorityRevocationListAttributeName);
0970:                hash = addHashCode(hash,
0971:                        ldapAttributeCertificateAttributeAttributeName);
0972:                hash = addHashCode(hash, ldapAACertificateAttributeName);
0973:                hash = addHashCode(hash,
0974:                        ldapAttributeDescriptorCertificateAttributeName);
0975:                hash = addHashCode(hash,
0976:                        ldapAttributeCertificateRevocationListAttributeName);
0977:                hash = addHashCode(hash,
0978:                        ldapAttributeAuthorityRevocationListAttributeName);
0979:                hash = addHashCode(hash, userCertificateSubjectAttributeName);
0980:                hash = addHashCode(hash, cACertificateSubjectAttributeName);
0981:                hash = addHashCode(hash, crossCertificateSubjectAttributeName);
0982:                hash = addHashCode(hash,
0983:                        certificateRevocationListIssuerAttributeName);
0984:                hash = addHashCode(hash, deltaRevocationListIssuerAttributeName);
0985:                hash = addHashCode(hash,
0986:                        authorityRevocationListIssuerAttributeName);
0987:                hash = addHashCode(hash,
0988:                        attributeCertificateAttributeSubjectAttributeName);
0989:                hash = addHashCode(hash, aACertificateSubjectAttributeName);
0990:                hash = addHashCode(hash,
0991:                        attributeDescriptorCertificateSubjectAttributeName);
0992:                hash = addHashCode(hash,
0993:                        attributeCertificateRevocationListIssuerAttributeName);
0994:                hash = addHashCode(hash,
0995:                        attributeAuthorityRevocationListIssuerAttributeName);
0996:                hash = addHashCode(hash, searchForSerialNumberIn);
0997:
0998:                return hash;
0999:            }
1000:
1001:            private int addHashCode(int hashCode, Object o) {
1002:                return (hashCode * 29) + (o == null ? 0 : o.hashCode());
1003:            }
1004:
1005:            /**
1006:             * @return Returns the aACertificateAttribute.
1007:             */
1008:            public String getAACertificateAttribute() {
1009:                return aACertificateAttribute;
1010:            }
1011:
1012:            /**
1013:             * @return Returns the aACertificateSubjectAttributeName.
1014:             */
1015:            public String getAACertificateSubjectAttributeName() {
1016:                return aACertificateSubjectAttributeName;
1017:            }
1018:
1019:            /**
1020:             * @return Returns the attributeAuthorityRevocationListAttribute.
1021:             */
1022:            public String getAttributeAuthorityRevocationListAttribute() {
1023:                return attributeAuthorityRevocationListAttribute;
1024:            }
1025:
1026:            /**
1027:             * @return Returns the attributeAuthorityRevocationListIssuerAttributeName.
1028:             */
1029:            public String getAttributeAuthorityRevocationListIssuerAttributeName() {
1030:                return attributeAuthorityRevocationListIssuerAttributeName;
1031:            }
1032:
1033:            /**
1034:             * @return Returns the attributeCertificateAttributeAttribute.
1035:             */
1036:            public String getAttributeCertificateAttributeAttribute() {
1037:                return attributeCertificateAttributeAttribute;
1038:            }
1039:
1040:            /**
1041:             * @return Returns the attributeCertificateAttributeSubjectAttributeName.
1042:             */
1043:            public String getAttributeCertificateAttributeSubjectAttributeName() {
1044:                return attributeCertificateAttributeSubjectAttributeName;
1045:            }
1046:
1047:            /**
1048:             * @return Returns the attributeCertificateRevocationListAttribute.
1049:             */
1050:            public String getAttributeCertificateRevocationListAttribute() {
1051:                return attributeCertificateRevocationListAttribute;
1052:            }
1053:
1054:            /**
1055:             * @return Returns the
1056:             *         attributeCertificateRevocationListIssuerAttributeName.
1057:             */
1058:            public String getAttributeCertificateRevocationListIssuerAttributeName() {
1059:                return attributeCertificateRevocationListIssuerAttributeName;
1060:            }
1061:
1062:            /**
1063:             * @return Returns the attributeDescriptorCertificateAttribute.
1064:             */
1065:            public String getAttributeDescriptorCertificateAttribute() {
1066:                return attributeDescriptorCertificateAttribute;
1067:            }
1068:
1069:            /**
1070:             * @return Returns the attributeDescriptorCertificateSubjectAttributeName.
1071:             */
1072:            public String getAttributeDescriptorCertificateSubjectAttributeName() {
1073:                return attributeDescriptorCertificateSubjectAttributeName;
1074:            }
1075:
1076:            /**
1077:             * @return Returns the authorityRevocationListAttribute.
1078:             */
1079:            public String getAuthorityRevocationListAttribute() {
1080:                return authorityRevocationListAttribute;
1081:            }
1082:
1083:            /**
1084:             * @return Returns the authorityRevocationListIssuerAttributeName.
1085:             */
1086:            public String getAuthorityRevocationListIssuerAttributeName() {
1087:                return authorityRevocationListIssuerAttributeName;
1088:            }
1089:
1090:            /**
1091:             * @return Returns the baseDN.
1092:             */
1093:            public String getBaseDN() {
1094:                return baseDN;
1095:            }
1096:
1097:            /**
1098:             * @return Returns the cACertificateAttribute.
1099:             */
1100:            public String getCACertificateAttribute() {
1101:                return cACertificateAttribute;
1102:            }
1103:
1104:            /**
1105:             * @return Returns the cACertificateSubjectAttributeName.
1106:             */
1107:            public String getCACertificateSubjectAttributeName() {
1108:                return cACertificateSubjectAttributeName;
1109:            }
1110:
1111:            /**
1112:             * @return Returns the certificateRevocationListAttribute.
1113:             */
1114:            public String getCertificateRevocationListAttribute() {
1115:                return certificateRevocationListAttribute;
1116:            }
1117:
1118:            /**
1119:             * @return Returns the certificateRevocationListIssuerAttributeName.
1120:             */
1121:            public String getCertificateRevocationListIssuerAttributeName() {
1122:                return certificateRevocationListIssuerAttributeName;
1123:            }
1124:
1125:            /**
1126:             * @return Returns the crossCertificateAttribute.
1127:             */
1128:            public String getCrossCertificateAttribute() {
1129:                return crossCertificateAttribute;
1130:            }
1131:
1132:            /**
1133:             * @return Returns the crossCertificateSubjectAttributeName.
1134:             */
1135:            public String getCrossCertificateSubjectAttributeName() {
1136:                return crossCertificateSubjectAttributeName;
1137:            }
1138:
1139:            /**
1140:             * @return Returns the deltaRevocationListAttribute.
1141:             */
1142:            public String getDeltaRevocationListAttribute() {
1143:                return deltaRevocationListAttribute;
1144:            }
1145:
1146:            /**
1147:             * @return Returns the deltaRevocationListIssuerAttributeName.
1148:             */
1149:            public String getDeltaRevocationListIssuerAttributeName() {
1150:                return deltaRevocationListIssuerAttributeName;
1151:            }
1152:
1153:            /**
1154:             * @return Returns the ldapAACertificateAttributeName.
1155:             */
1156:            public String getLdapAACertificateAttributeName() {
1157:                return ldapAACertificateAttributeName;
1158:            }
1159:
1160:            /**
1161:             * @return Returns the ldapAttributeAuthorityRevocationListAttributeName.
1162:             */
1163:            public String getLdapAttributeAuthorityRevocationListAttributeName() {
1164:                return ldapAttributeAuthorityRevocationListAttributeName;
1165:            }
1166:
1167:            /**
1168:             * @return Returns the ldapAttributeCertificateAttributeAttributeName.
1169:             */
1170:            public String getLdapAttributeCertificateAttributeAttributeName() {
1171:                return ldapAttributeCertificateAttributeAttributeName;
1172:            }
1173:
1174:            /**
1175:             * @return Returns the ldapAttributeCertificateRevocationListAttributeName.
1176:             */
1177:            public String getLdapAttributeCertificateRevocationListAttributeName() {
1178:                return ldapAttributeCertificateRevocationListAttributeName;
1179:            }
1180:
1181:            /**
1182:             * @return Returns the ldapAttributeDescriptorCertificateAttributeName.
1183:             */
1184:            public String getLdapAttributeDescriptorCertificateAttributeName() {
1185:                return ldapAttributeDescriptorCertificateAttributeName;
1186:            }
1187:
1188:            /**
1189:             * @return Returns the ldapAuthorityRevocationListAttributeName.
1190:             */
1191:            public String getLdapAuthorityRevocationListAttributeName() {
1192:                return ldapAuthorityRevocationListAttributeName;
1193:            }
1194:
1195:            /**
1196:             * @return Returns the ldapCACertificateAttributeName.
1197:             */
1198:            public String getLdapCACertificateAttributeName() {
1199:                return ldapCACertificateAttributeName;
1200:            }
1201:
1202:            /**
1203:             * @return Returns the ldapCertificateRevocationListAttributeName.
1204:             */
1205:            public String getLdapCertificateRevocationListAttributeName() {
1206:                return ldapCertificateRevocationListAttributeName;
1207:            }
1208:
1209:            /**
1210:             * @return Returns the ldapCrossCertificateAttributeName.
1211:             */
1212:            public String getLdapCrossCertificateAttributeName() {
1213:                return ldapCrossCertificateAttributeName;
1214:            }
1215:
1216:            /**
1217:             * @return Returns the ldapDeltaRevocationListAttributeName.
1218:             */
1219:            public String getLdapDeltaRevocationListAttributeName() {
1220:                return ldapDeltaRevocationListAttributeName;
1221:            }
1222:
1223:            /**
1224:             * @return Returns the ldapURL.
1225:             */
1226:            public String getLdapURL() {
1227:                return ldapURL;
1228:            }
1229:
1230:            /**
1231:             * @return Returns the ldapUserCertificateAttributeName.
1232:             */
1233:            public String getLdapUserCertificateAttributeName() {
1234:                return ldapUserCertificateAttributeName;
1235:            }
1236:
1237:            /**
1238:             * @return Returns the searchForSerialNumberIn.
1239:             */
1240:            public String getSearchForSerialNumberIn() {
1241:                return searchForSerialNumberIn;
1242:            }
1243:
1244:            /**
1245:             * @return Returns the userCertificateAttribute.
1246:             */
1247:            public String getUserCertificateAttribute() {
1248:                return userCertificateAttribute;
1249:            }
1250:
1251:            /**
1252:             * @return Returns the userCertificateSubjectAttributeName.
1253:             */
1254:            public String getUserCertificateSubjectAttributeName() {
1255:                return userCertificateSubjectAttributeName;
1256:            }
1257:
1258:            public static X509LDAPCertStoreParameters getInstance(
1259:                    LDAPCertStoreParameters params) {
1260:                String server = "ldap://" + params.getServerName() + ":"
1261:                        + params.getPort();
1262:                X509LDAPCertStoreParameters _params = new Builder(server, "")
1263:                        .build();
1264:                return _params;
1265:            }
1266:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.