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


001:        package org.bouncycastle.asn1.x509;
002:
003:        import org.bouncycastle.asn1.ASN1Encodable;
004:        import org.bouncycastle.asn1.ASN1EncodableVector;
005:        import org.bouncycastle.asn1.ASN1Sequence;
006:        import org.bouncycastle.asn1.ASN1TaggedObject;
007:        import org.bouncycastle.asn1.DERBitString;
008:        import org.bouncycastle.asn1.DERObject;
009:        import org.bouncycastle.asn1.DERSequence;
010:        import org.bouncycastle.asn1.DERTaggedObject;
011:
012:        /**
013:         * The DistributionPoint object.
014:         * <pre>
015:         * DistributionPoint ::= SEQUENCE {
016:         *      distributionPoint [0] DistributionPointName OPTIONAL,
017:         *      reasons           [1] ReasonFlags OPTIONAL,
018:         *      cRLIssuer         [2] GeneralNames OPTIONAL
019:         * }
020:         * </pre>
021:         */
022:        public class DistributionPoint extends ASN1Encodable {
023:            DistributionPointName distributionPoint;
024:            ReasonFlags reasons;
025:            GeneralNames cRLIssuer;
026:
027:            public static DistributionPoint getInstance(ASN1TaggedObject obj,
028:                    boolean explicit) {
029:                return getInstance(ASN1Sequence.getInstance(obj, explicit));
030:            }
031:
032:            public static DistributionPoint getInstance(Object obj) {
033:                if (obj == null || obj instanceof  DistributionPoint) {
034:                    return (DistributionPoint) obj;
035:                }
036:
037:                if (obj instanceof  ASN1Sequence) {
038:                    return new DistributionPoint((ASN1Sequence) obj);
039:                }
040:
041:                throw new IllegalArgumentException(
042:                        "Invalid DistributionPoint: "
043:                                + obj.getClass().getName());
044:            }
045:
046:            public DistributionPoint(ASN1Sequence seq) {
047:                for (int i = 0; i != seq.size(); i++) {
048:                    ASN1TaggedObject t = ASN1TaggedObject.getInstance(seq
049:                            .getObjectAt(i));
050:                    switch (t.getTagNo()) {
051:                    case 0:
052:                        distributionPoint = DistributionPointName.getInstance(
053:                                t, true);
054:                        break;
055:                    case 1:
056:                        reasons = new ReasonFlags(DERBitString.getInstance(t,
057:                                false));
058:                        break;
059:                    case 2:
060:                        cRLIssuer = GeneralNames.getInstance(t, false);
061:                    }
062:                }
063:            }
064:
065:            public DistributionPoint(DistributionPointName distributionPoint,
066:                    ReasonFlags reasons, GeneralNames cRLIssuer) {
067:                this .distributionPoint = distributionPoint;
068:                this .reasons = reasons;
069:                this .cRLIssuer = cRLIssuer;
070:            }
071:
072:            public DistributionPointName getDistributionPoint() {
073:                return distributionPoint;
074:            }
075:
076:            public ReasonFlags getReasons() {
077:                return reasons;
078:            }
079:
080:            public GeneralNames getCRLIssuer() {
081:                return cRLIssuer;
082:            }
083:
084:            public DERObject toASN1Object() {
085:                ASN1EncodableVector v = new ASN1EncodableVector();
086:
087:                if (distributionPoint != null) {
088:                    //
089:                    // as this is a CHOICE it must be explicitly tagged
090:                    //
091:                    v.add(new DERTaggedObject(0, distributionPoint));
092:                }
093:
094:                if (reasons != null) {
095:                    v.add(new DERTaggedObject(false, 1, reasons));
096:                }
097:
098:                if (cRLIssuer != null) {
099:                    v.add(new DERTaggedObject(false, 2, cRLIssuer));
100:                }
101:
102:                return new DERSequence(v);
103:            }
104:
105:            public String toString() {
106:                String sep = System.getProperty("line.separator");
107:                StringBuffer buf = new StringBuffer();
108:                buf.append("DistributionPoint: [");
109:                buf.append(sep);
110:                if (distributionPoint != null) {
111:                    appendObject(buf, sep, "distributionPoint",
112:                            distributionPoint.toString());
113:                }
114:                if (reasons != null) {
115:                    appendObject(buf, sep, "reasons", reasons.toString());
116:                }
117:                if (cRLIssuer != null) {
118:                    appendObject(buf, sep, "cRLIssuer", cRLIssuer.toString());
119:                }
120:                buf.append("]");
121:                buf.append(sep);
122:                return buf.toString();
123:            }
124:
125:            private void appendObject(StringBuffer buf, String sep,
126:                    String name, String value) {
127:                String indent = "    ";
128:
129:                buf.append(indent);
130:                buf.append(name);
131:                buf.append(":");
132:                buf.append(sep);
133:                buf.append(indent);
134:                buf.append(indent);
135:                buf.append(value);
136:                buf.append(sep);
137:            }
138:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.