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


001:        package org.bouncycastle.x509;
002:
003:        import org.bouncycastle.util.Selector;
004:
005:        /**
006:         * This class is an <code>Selector</code> like implementation to select
007:         * certificates pairs, which are e.g. used for cross certificates. The set of
008:         * criteria is given from two
009:         * {@link org.bouncycastle.x509.X509CertStoreSelector}s which must be both
010:         * matched.
011:         * 
012:         * @see org.bouncycastle.x509.X509AttributeCertificate
013:         * @see org.bouncycastle.x509.X509Store
014:         */
015:        public class X509CertPairStoreSelector implements  Selector {
016:
017:            private X509CertStoreSelector forwardSelector;
018:
019:            private X509CertStoreSelector reverseSelector;
020:
021:            private X509CertificatePair certPair;
022:
023:            public X509CertPairStoreSelector() {
024:            }
025:
026:            /**
027:             * Returns the certificate pair which is used for testing on equality.
028:             * 
029:             * @return Returns the certificate pair which is checked.
030:             */
031:            public X509CertificatePair getCertPair() {
032:                return certPair;
033:            }
034:
035:            /**
036:             * Set the certificate pair which is used for testing on equality.
037:             * 
038:             * @param certPair The certPairChecking to set.
039:             */
040:            public void setCertPair(X509CertificatePair certPair) {
041:                this .certPair = certPair;
042:            }
043:
044:            /**
045:             * @param forwardSelector The certificate selector for the forward part in
046:             *            the pair.
047:             */
048:            public void setForwardSelector(X509CertStoreSelector forwardSelector) {
049:                this .forwardSelector = forwardSelector;
050:            }
051:
052:            /**
053:             * @param reverseSelector The certificate selector for the reverse part in
054:             *            the pair.
055:             */
056:            public void setReverseSelector(X509CertStoreSelector reverseSelector) {
057:                this .reverseSelector = reverseSelector;
058:            }
059:
060:            /**
061:             * Returns a clone of this selector.
062:             * 
063:             * @return A clone of this selector.
064:             * @see java.lang.Object#clone()
065:             */
066:            public Object clone() {
067:                X509CertPairStoreSelector cln = new X509CertPairStoreSelector();
068:
069:                cln.certPair = certPair;
070:
071:                if (forwardSelector != null) {
072:                    cln
073:                            .setForwardSelector((X509CertStoreSelector) forwardSelector
074:                                    .clone());
075:                }
076:
077:                if (reverseSelector != null) {
078:                    cln
079:                            .setReverseSelector((X509CertStoreSelector) reverseSelector
080:                                    .clone());
081:                }
082:
083:                return cln;
084:            }
085:
086:            /**
087:             * Decides if the given certificate pair should be selected. If
088:             * <code>obj</code> is not a {@link X509CertificatePair} this method
089:             * returns <code>false</code>.
090:             * 
091:             * @param obj The {@link X509CertificatePair} which should be tested.
092:             * @return <code>true</code> if the object matches this selector.
093:             */
094:            public boolean match(Object obj) {
095:                try {
096:                    if (!(obj instanceof  X509CertificatePair)) {
097:                        return false;
098:                    }
099:                    X509CertificatePair pair = (X509CertificatePair) obj;
100:
101:                    if (forwardSelector != null
102:                            && !forwardSelector.match((Object) pair
103:                                    .getForward())) {
104:                        return false;
105:                    }
106:
107:                    if (reverseSelector != null
108:                            && !reverseSelector.match((Object) pair
109:                                    .getReverse())) {
110:                        return false;
111:                    }
112:
113:                    if (certPair != null) {
114:                        return certPair.equals(obj);
115:                    }
116:
117:                    return true;
118:                } catch (Exception e) {
119:                    return false;
120:                }
121:            }
122:
123:            /**
124:             * Returns the certicate selector for the forward part.
125:             * 
126:             * @return Returns the certicate selector for the forward part.
127:             */
128:            public X509CertStoreSelector getForwardSelector() {
129:                return forwardSelector;
130:            }
131:
132:            /**
133:             * Returns the certicate selector for the reverse part.
134:             * 
135:             * @return Returns the reverse selector for teh reverse part.
136:             */
137:            public X509CertStoreSelector getReverseSelector() {
138:                return reverseSelector;
139:            }
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.