Source Code Cross Referenced for SignedData.java in  » Web-Mail » oyster » org » enhydra » oyster » 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 » Web Mail » oyster » org.enhydra.oyster.cms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Title:        Oyster Project
003:         * Description:  S/MIME email sending capabilities
004:         * @Author       Vladimir Radisic
005:         * @Version      2.1.6
006:         */
007:
008:        package org.enhydra.oyster.cms;
009:
010:        import org.enhydra.oyster.exception.SMIMEException;
011:        import org.enhydra.oyster.der.DERSequencePr;
012:
013:        /**
014:         * SignedData is DER encoded container for information represented in
015:         * ASN.1 notation according to RFC2630, used for construction CMS objects
016:         * of signed messages.<BR>
017:         * <BR>
018:         * <DL>
019:         * SignedData ::= SEQUENCE {<BR>
020:         * <DD>       version CMSVersion,<BR>
021:         * <DD>       digestAlgorithms DigestAlgorithmIdentifiers,<BR>
022:         * <DD>       encapContentInfo EncapsulatedContentInfo,<BR>
023:         * <DD>       certificates [0] IMPLICIT CertificateSet OPTIONAL,<BR>
024:         * <DD>       crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,<BR>
025:         * <DD>       signerInfos SignerInfos }<BR>
026:         * </DL>
027:         */
028:        public class SignedData extends DERSequencePr {
029:
030:            /**
031:             * Determinate order of adding commponents
032:             */
033:            int orderIdentifier = 0;
034:
035:            /**
036:             * Constructs an empty Signed Data
037:             * @exception SMIMEException thrown in super class constructor.
038:             */
039:            public SignedData() throws SMIMEException {
040:            }
041:
042:            /**
043:             * Adds DER encoded CMS Version
044:             * @param ver0 DER encoded CMS version represented as byte array
045:             * @exception SMIMEException if order of adding components is wrong. Also,
046:             * exception could be thrown in super class addContent method.
047:             */
048:            public void addCMSVersion(byte[] ver0) throws SMIMEException {
049:                if (orderIdentifier == 0) {
050:                    super .addContent(ver0);
051:                    orderIdentifier++;
052:                } else
053:                    throw new SMIMEException(1018);
054:            }
055:
056:            /**
057:             * Adds DER encoded Digest Algorithm Identifier
058:             * @param digAlg0 DER encoded Digest Algorithm Identifier as byte array
059:             * @exception SMIMEException if order of adding components is wrong. Also,
060:             * exception could be thrown in super class addContent method.
061:             */
062:            public void addDigestAlgorithm(byte[] digAlg0)
063:                    throws SMIMEException {
064:                if (orderIdentifier == 1) {
065:                    super .addContent(digAlg0);
066:                    orderIdentifier++;
067:                } else
068:                    throw new SMIMEException(1018);
069:            }
070:
071:            /**
072:             * Adds DER encoded Encapsulated Content Info
073:             * @param encCont0 DER encoded Encapsulated Content Info as byte array
074:             * @exception SMIMEException if order of adding components is wrong. Also,
075:             * exception could be thrown in super class addContent method.
076:             */
077:            public void addEncapsulatedContentInfo(byte[] encCont0)
078:                    throws SMIMEException {
079:                if (orderIdentifier == 2) {
080:                    super .addContent(encCont0);
081:                    orderIdentifier++;
082:                } else
083:                    throw new SMIMEException(1018);
084:            }
085:
086:            /**
087:             * Adds DER encoded Certificate container with one or more X509 certificates
088:             * @param cert0 DER encoded Certificate container
089:             * @exception SMIMEException if order of adding components is wrong. Also,
090:             * exception could be thrown in super class addContent method.
091:             */
092:            public void addCertificate(byte[] cert0) throws SMIMEException {
093:                if (orderIdentifier == 3) {
094:                    super .addContent(cert0);
095:                    orderIdentifier++;
096:                } else
097:                    throw new SMIMEException(1018);
098:            }
099:
100:            /**
101:             * Adds DER encoded Signer Infos
102:             * @param info0 DER encoded Signer Infos
103:             * @exception SMIMEException if order of adding components is wrong. Also,
104:             * exception could be thrown in super class addContent method.
105:             */
106:            public void addSignerInfos(byte[] info0) throws SMIMEException {
107:                if (orderIdentifier == 3) {
108:                    super .addContent(info0);
109:                    orderIdentifier++;
110:                    orderIdentifier++;
111:                } else if (orderIdentifier == 4) {
112:                    super .addContent(info0);
113:                    orderIdentifier++;
114:                } else
115:                    throw new SMIMEException(1018);
116:            }
117:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.