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


001:        package org.bouncycastle.asn1.cmp;
002:
003:        import java.math.BigInteger;
004:
005:        import org.bouncycastle.asn1.ASN1Encodable;
006:        import org.bouncycastle.asn1.ASN1EncodableVector;
007:        import org.bouncycastle.asn1.ASN1Sequence;
008:        import org.bouncycastle.asn1.ASN1TaggedObject;
009:        import org.bouncycastle.asn1.DERBitString;
010:        import org.bouncycastle.asn1.DERInteger;
011:        import org.bouncycastle.asn1.DERObject;
012:        import org.bouncycastle.asn1.DERSequence;
013:
014:        public class PKIStatusInfo extends ASN1Encodable {
015:            DERInteger status;
016:            PKIFreeText statusString;
017:            DERBitString failInfo;
018:
019:            public static PKIStatusInfo getInstance(ASN1TaggedObject obj,
020:                    boolean explicit) {
021:                return getInstance(ASN1Sequence.getInstance(obj, explicit));
022:            }
023:
024:            public static PKIStatusInfo getInstance(Object obj) {
025:                if (obj instanceof  PKIStatusInfo) {
026:                    return (PKIStatusInfo) obj;
027:                } else if (obj instanceof  ASN1Sequence) {
028:                    return new PKIStatusInfo((ASN1Sequence) obj);
029:                }
030:
031:                throw new IllegalArgumentException(
032:                        "unknown object in factory: " + obj.getClass());
033:            }
034:
035:            public PKIStatusInfo(ASN1Sequence seq) {
036:                this .status = DERInteger.getInstance(seq.getObjectAt(0));
037:
038:                this .statusString = null;
039:                this .failInfo = null;
040:
041:                if (seq.size() > 2) {
042:                    this .statusString = PKIFreeText.getInstance(seq
043:                            .getObjectAt(1));
044:                    this .failInfo = DERBitString
045:                            .getInstance(seq.getObjectAt(2));
046:                } else if (seq.size() > 1) {
047:                    Object obj = seq.getObjectAt(1);
048:                    if (obj instanceof  DERBitString) {
049:                        this .failInfo = DERBitString.getInstance(obj);
050:                    } else {
051:                        this .statusString = PKIFreeText.getInstance(obj);
052:                    }
053:                }
054:            }
055:
056:            /**
057:             * @param status
058:             */
059:            public PKIStatusInfo(int status) {
060:                this .status = new DERInteger(status);
061:            }
062:
063:            /**
064:             * @param status
065:             * @param statusString
066:             */
067:            public PKIStatusInfo(int status, PKIFreeText statusString) {
068:                this .status = new DERInteger(status);
069:                this .statusString = statusString;
070:            }
071:
072:            public PKIStatusInfo(int status, PKIFreeText statusString,
073:                    PKIFailureInfo failInfo) {
074:                this .status = new DERInteger(status);
075:                this .statusString = statusString;
076:                this .failInfo = failInfo;
077:            }
078:
079:            public BigInteger getStatus() {
080:                return status.getValue();
081:            }
082:
083:            public PKIFreeText getStatusString() {
084:                return statusString;
085:            }
086:
087:            public DERBitString getFailInfo() {
088:                return failInfo;
089:            }
090:
091:            /**
092:             * <pre>
093:             * PKIStatusInfo ::= SEQUENCE {
094:             *     status        PKIStatus,                (INTEGER)
095:             *     statusString  PKIFreeText     OPTIONAL,
096:             *     failInfo      PKIFailureInfo  OPTIONAL  (BIT STRING)
097:             * }
098:             *
099:             * PKIStatus:
100:             *   granted                (0), -- you got exactly what you asked for
101:             *   grantedWithMods        (1), -- you got something like what you asked for
102:             *   rejection              (2), -- you don't get it, more information elsewhere in the message
103:             *   waiting                (3), -- the request body part has not yet been processed, expect to hear more later
104:             *   revocationWarning      (4), -- this message contains a warning that a revocation is imminent
105:             *   revocationNotification (5), -- notification that a revocation has occurred
106:             *   keyUpdateWarning       (6)  -- update already done for the oldCertId specified in CertReqMsg
107:             *
108:             * PKIFailureInfo:
109:             *   badAlg           (0), -- unrecognized or unsupported Algorithm Identifier
110:             *   badMessageCheck  (1), -- integrity check failed (e.g., signature did not verify)
111:             *   badRequest       (2), -- transaction not permitted or supported
112:             *   badTime          (3), -- messageTime was not sufficiently close to the system time, as defined by local policy
113:             *   badCertId        (4), -- no certificate could be found matching the provided criteria
114:             *   badDataFormat    (5), -- the data submitted has the wrong format
115:             *   wrongAuthority   (6), -- the authority indicated in the request is different from the one creating the response token
116:             *   incorrectData    (7), -- the requester's data is incorrect (for notary services)
117:             *   missingTimeStamp (8), -- when the timestamp is missing but should be there (by policy)
118:             *   badPOP           (9)  -- the proof-of-possession failed
119:             *
120:             * </pre>
121:             */
122:            public DERObject toASN1Object() {
123:                ASN1EncodableVector v = new ASN1EncodableVector();
124:
125:                v.add(status);
126:
127:                if (statusString != null) {
128:                    v.add(statusString);
129:                }
130:
131:                if (failInfo != null) {
132:                    v.add(failInfo);
133:                }
134:
135:                return new DERSequence(v);
136:            }
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.