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


001:        package org.bouncycastle.asn1.cms;
002:
003:        import org.bouncycastle.asn1.ASN1SequenceParser;
004:        import org.bouncycastle.asn1.ASN1SetParser;
005:        import org.bouncycastle.asn1.ASN1TaggedObjectParser;
006:        import org.bouncycastle.asn1.DEREncodable;
007:        import org.bouncycastle.asn1.DERInteger;
008:        import org.bouncycastle.asn1.DERTags;
009:
010:        import java.io.IOException;
011:
012:        /** 
013:         * <pre>
014:         * EnvelopedData ::= SEQUENCE {
015:         *     version CMSVersion,
016:         *     originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
017:         *     recipientInfos RecipientInfos,
018:         *     encryptedContentInfo EncryptedContentInfo,
019:         *     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL 
020:         * }
021:         * </pre>
022:         */
023:        public class EnvelopedDataParser {
024:            private ASN1SequenceParser _seq;
025:            private DERInteger _version;
026:            private DEREncodable _nextObject;
027:            private boolean _originatorInfoCalled;
028:
029:            public EnvelopedDataParser(ASN1SequenceParser seq)
030:                    throws IOException {
031:                this ._seq = seq;
032:                this ._version = (DERInteger) seq.readObject();
033:            }
034:
035:            public DERInteger getVersion() {
036:                return _version;
037:            }
038:
039:            public ASN1SetParser getCertificates() throws IOException {
040:                if (_nextObject == null) {
041:                    _nextObject = _seq.readObject();
042:                }
043:
044:                if (_nextObject instanceof  ASN1TaggedObjectParser
045:                        && ((ASN1TaggedObjectParser) _nextObject).getTagNo() == 0) {
046:                    ASN1SetParser certs = (ASN1SetParser) ((ASN1TaggedObjectParser) _nextObject)
047:                            .getObjectParser(DERTags.SET, false);
048:                    _nextObject = null;
049:
050:                    return certs;
051:                }
052:
053:                return null;
054:            }
055:
056:            public ASN1SetParser getCrls() throws IOException {
057:                if (_nextObject == null) {
058:                    _nextObject = _seq.readObject();
059:                }
060:
061:                if (_nextObject instanceof  ASN1TaggedObjectParser
062:                        && ((ASN1TaggedObjectParser) _nextObject).getTagNo() == 1) {
063:                    ASN1SetParser crls = (ASN1SetParser) ((ASN1TaggedObjectParser) _nextObject)
064:                            .getObjectParser(DERTags.SET, false);
065:                    _nextObject = null;
066:
067:                    return crls;
068:                }
069:
070:                return null;
071:            }
072:
073:            public OriginatorInfo getOriginatorInfo() throws IOException {
074:                _originatorInfoCalled = true;
075:
076:                if (_nextObject == null) {
077:                    _nextObject = _seq.readObject();
078:                }
079:
080:                if (_nextObject instanceof  ASN1TaggedObjectParser
081:                        && ((ASN1TaggedObjectParser) _nextObject).getTagNo() == 0) {
082:                    ASN1SequenceParser originatorInfo = (ASN1SequenceParser) ((ASN1TaggedObjectParser) _nextObject)
083:                            .getObjectParser(DERTags.SEQUENCE, false);
084:                    _nextObject = null;
085:                    return OriginatorInfo.getInstance(originatorInfo
086:                            .getDERObject());
087:                }
088:
089:                return null;
090:            }
091:
092:            public ASN1SetParser getRecipientInfos() throws IOException {
093:                if (!_originatorInfoCalled) {
094:                    getOriginatorInfo();
095:                }
096:
097:                if (_nextObject == null) {
098:                    _nextObject = _seq.readObject();
099:                }
100:
101:                ASN1SetParser recipientInfos = (ASN1SetParser) _nextObject;
102:                _nextObject = null;
103:                return recipientInfos;
104:            }
105:
106:            public EncryptedContentInfoParser getEncryptedContentInfo()
107:                    throws IOException {
108:                if (_nextObject == null) {
109:                    _nextObject = _seq.readObject();
110:                }
111:
112:                if (_nextObject != null) {
113:                    ASN1SequenceParser o = (ASN1SequenceParser) _nextObject;
114:                    _nextObject = null;
115:                    return new EncryptedContentInfoParser(o);
116:                }
117:
118:                return null;
119:            }
120:
121:            public ASN1SetParser getUnprotectedAttrs() throws IOException {
122:                if (_nextObject == null) {
123:                    _nextObject = _seq.readObject();
124:                }
125:
126:                if (_nextObject != null) {
127:                    DEREncodable o = _nextObject;
128:                    _nextObject = null;
129:                    return (ASN1SetParser) ((ASN1TaggedObjectParser) o)
130:                            .getObjectParser(DERTags.SET, false);
131:                }
132:
133:                return null;
134:            }
135:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.