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


001:        package org.bouncycastle.asn1.ocsp;
002:
003:        import org.bouncycastle.asn1.ASN1EncodableVector;
004:        import org.bouncycastle.asn1.ASN1Sequence;
005:        import org.bouncycastle.asn1.ASN1TaggedObject;
006:        import org.bouncycastle.asn1.ASN1Encodable;
007:        import org.bouncycastle.asn1.DERGeneralizedTime;
008:        import org.bouncycastle.asn1.DERInteger;
009:        import org.bouncycastle.asn1.DERObject;
010:        import org.bouncycastle.asn1.DERSequence;
011:        import org.bouncycastle.asn1.DERTaggedObject;
012:        import org.bouncycastle.asn1.x509.X509Extensions;
013:
014:        public class ResponseData extends ASN1Encodable {
015:            private static final DERInteger V1 = new DERInteger(0);
016:
017:            private boolean versionPresent;
018:
019:            private DERInteger version;
020:            private ResponderID responderID;
021:            private DERGeneralizedTime producedAt;
022:            private ASN1Sequence responses;
023:            private X509Extensions responseExtensions;
024:
025:            public ResponseData(DERInteger version, ResponderID responderID,
026:                    DERGeneralizedTime producedAt, ASN1Sequence responses,
027:                    X509Extensions responseExtensions) {
028:                this .version = version;
029:                this .responderID = responderID;
030:                this .producedAt = producedAt;
031:                this .responses = responses;
032:                this .responseExtensions = responseExtensions;
033:            }
034:
035:            public ResponseData(ResponderID responderID,
036:                    DERGeneralizedTime producedAt, ASN1Sequence responses,
037:                    X509Extensions responseExtensions) {
038:                this (V1, responderID, producedAt, responses, responseExtensions);
039:            }
040:
041:            public ResponseData(ASN1Sequence seq) {
042:                int index = 0;
043:
044:                if (seq.getObjectAt(0) instanceof  ASN1TaggedObject) {
045:                    ASN1TaggedObject o = (ASN1TaggedObject) seq.getObjectAt(0);
046:
047:                    if (o.getTagNo() == 0) {
048:                        this .versionPresent = true;
049:                        this .version = DERInteger.getInstance(
050:                                (ASN1TaggedObject) seq.getObjectAt(0), true);
051:                        index++;
052:                    } else {
053:                        this .version = V1;
054:                    }
055:                } else {
056:                    this .version = V1;
057:                }
058:
059:                this .responderID = ResponderID.getInstance(seq
060:                        .getObjectAt(index++));
061:                this .producedAt = (DERGeneralizedTime) seq.getObjectAt(index++);
062:                this .responses = (ASN1Sequence) seq.getObjectAt(index++);
063:
064:                if (seq.size() > index) {
065:                    this .responseExtensions = X509Extensions.getInstance(
066:                            (ASN1TaggedObject) seq.getObjectAt(index), true);
067:                }
068:            }
069:
070:            public static ResponseData getInstance(ASN1TaggedObject obj,
071:                    boolean explicit) {
072:                return getInstance(ASN1Sequence.getInstance(obj, explicit));
073:            }
074:
075:            public static ResponseData getInstance(Object obj) {
076:                if (obj == null || obj instanceof  ResponseData) {
077:                    return (ResponseData) obj;
078:                } else if (obj instanceof  ASN1Sequence) {
079:                    return new ResponseData((ASN1Sequence) obj);
080:                }
081:
082:                throw new IllegalArgumentException("unknown object in factory");
083:            }
084:
085:            public DERInteger getVersion() {
086:                return version;
087:            }
088:
089:            public ResponderID getResponderID() {
090:                return responderID;
091:            }
092:
093:            public DERGeneralizedTime getProducedAt() {
094:                return producedAt;
095:            }
096:
097:            public ASN1Sequence getResponses() {
098:                return responses;
099:            }
100:
101:            public X509Extensions getResponseExtensions() {
102:                return responseExtensions;
103:            }
104:
105:            /**
106:             * Produce an object suitable for an ASN1OutputStream.
107:             * <pre>
108:             * ResponseData ::= SEQUENCE {
109:             *     version              [0] EXPLICIT Version DEFAULT v1,
110:             *     responderID              ResponderID,
111:             *     producedAt               GeneralizedTime,
112:             *     responses                SEQUENCE OF SingleResponse,
113:             *     responseExtensions   [1] EXPLICIT Extensions OPTIONAL }
114:             * </pre>
115:             */
116:            public DERObject toASN1Object() {
117:                ASN1EncodableVector v = new ASN1EncodableVector();
118:
119:                if (versionPresent || !version.equals(V1)) {
120:                    v.add(new DERTaggedObject(true, 0, version));
121:                }
122:
123:                v.add(responderID);
124:                v.add(producedAt);
125:                v.add(responses);
126:                if (responseExtensions != null) {
127:                    v.add(new DERTaggedObject(true, 1, responseExtensions));
128:                }
129:
130:                return new DERSequence(v);
131:            }
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.