|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.webdocwf.util.smime.activation.CMSEnvelopedDataSource
CMSEnvelopedDataSource represents implementation of DataSource interfaces. It is used within MimeMessage as a source of data. Also, object of this class is used to create DER encoded Cryptographic Message Syntax (CMS) object represented in ASN.1 notation according to RFC2630. This object (CMS) is used as the source of data for MimeMessage in the process of sending encrypted message.
Constructor Summary | |
CMSEnvelopedDataSource(byte[] message0,
java.lang.String algType0,
int keyLength0)
Constructs CMS object for encryption with MIME Message in form of byte array and with given values for encryption algorithm. |
|
CMSEnvelopedDataSource(javax.mail.internet.MimeMessage message0,
java.lang.String algType0,
int keyLength0)
Constructs CMS object for encryption with MIME Message in form of instance of MimeMessage class and with defined values for encryption algorithm. |
Method Summary | |
void |
addRecipient(java.security.cert.X509Certificate cert0)
Adds recipient. |
byte[] |
getBASE64CMSEnvelopedObject()
Returns complete DER encoded CMS Enveloped Object with BASE64 encoding |
byte[] |
getCMSEnvelopedObject()
Returns complete DER encoded CMS Enveloped Object. |
java.lang.String |
getContentType()
Implements getContentType method from DataSource interface |
java.io.InputStream |
getInputStream()
Implements getInputStream method from DataSource interface |
java.lang.String |
getName()
ImplementS getName method from DataSource interface |
java.io.OutputStream |
getOutputStream()
Implements getOutputStream method from DataSource interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMSEnvelopedDataSource(byte[] message0, java.lang.String algType0, int keyLength0) throws SMIMEException
message0
- message for encryptionalgType0
- given symmetric algorithm for encryptionkeyLength0
- key length in bitsSMIMEException
- in case of unrecognized type of symmetryc
algorithm or invalid key length. Also, it can be caused by problems in
construction or work with some inner objects instantiated from classes
that belong to org.webdocwf.util.smime.der or org.webdocwf.util.smime.cms
packages used in other CMSEnvelopedDataSource constructor.public CMSEnvelopedDataSource(javax.mail.internet.MimeMessage message0, java.lang.String algType0, int keyLength0) throws SMIMEException
message0
- message for encryptionalgType0
- given symmetric algorithm for encryptionkeyLength0
- key length in bitsSMIMEException
- in case of unrecognized type of symmetryc
algorithm, invalid key length or in case of failure in MimeMessageConvertor
class which performes transformation from MimeMessage object to byte array.
Also, it can be caused by problems in construction or work with some
inner objects instantiated from classes that belong to
org.webdocwf.util.smime.der or org.webdocwf.util.smime.cms packages used
in other CMSEnvelopedDataSource constructor.Method Detail |
public void addRecipient(java.security.cert.X509Certificate cert0) throws SMIMEException
cert0
- recipient's X509Certificate (.cer file).SMIMEException
- caused by addRecipient method of inner object
which is instance of class RecipientInfos.public byte[] getCMSEnvelopedObject() throws SMIMEException
SMIMEException
- caused by problems in construction or work
with some inner objects instantiated from classes that belong to
org.webdocwf.util.smime.der or org.webdocwf.util.smime.cms packages.public byte[] getBASE64CMSEnvelopedObject() throws SMIMEException
SMIMEException
- in case of failure in Base64 encoding performed
on the generated SMIME message byte array by Base64ForMime class. Also, it
can be caused by problems in construction or work with some inner objects
instantiated from classes that belong to org.webdocwf.util.smime.der or
org.webdocwf.util.smime.cms packages used in getCMSEnvelopedObject() method.public java.lang.String getContentType()
getContentType
in interface javax.activation.DataSource
public java.io.InputStream getInputStream() throws SMIMEIOException
getInputStream
in interface javax.activation.DataSource
SMIMEIOException
- thrown as result of SMIMEExceptionpublic java.lang.String getName()
getName
in interface javax.activation.DataSource
public java.io.OutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface javax.activation.DataSource
java.io.IOException
- is always thrown when this method is used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |