|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.webdocwf.util.smime.activation.CMSSignedDataSource
CMSSignedDataSource 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 signed message.
Constructor Summary | |
CMSSignedDataSource(byte[] message0,
boolean externalSignature0)
Constructs CMS object for signing with Mime Message in form of byte array and with given value for type of CMSSignedDataSource (type of signing). |
|
CMSSignedDataSource(javax.mail.internet.MimeMessage message0,
boolean externalSignature0)
Constructs CMS object for signing with Mime Message in form of instance of MimeMessage class and with given value for type of CMSSignedDataSource (type of signing). |
Method Summary | |
void |
addCertificate(java.security.cert.X509Certificate cert0)
Adds the Certificate |
void |
addSigner(java.security.KeyStore pfx0,
boolean includingCert0,
boolean includingSignAttrib0,
java.lang.String signingAlg0)
Adds Signer. |
void |
addSigner(java.security.cert.X509Certificate[] chain0,
java.security.PrivateKey privKey0,
boolean includingCert0,
boolean includingSignAttrib0,
java.lang.String signingAlg0)
Adds Signer. |
byte[] |
getBASE64CMSSignedObject()
Returns complete DER encoded CMS Signed Object with BASE64 encoding |
byte[] |
getCMSSignedObject()
Returns complete DER encoded CMS Signed 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. |
void |
setCapabilities(java.lang.String type0,
int par10,
int par20,
int par30,
int par40,
int par50)
Sets Capabilities Attributes (method is optional, but if exists, must be performed before addSigner method). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CMSSignedDataSource(byte[] message0, boolean externalSignature0) throws SMIMEException
message0
- message for encryptionexternalSignature0
- true = external signing, false = internal
signingSMIMEException
- 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 CMSEnvelopedObject constructor.public CMSSignedDataSource(javax.mail.internet.MimeMessage message0, boolean externalSignature0) throws SMIMEException
message0
- message for encryptionexternalSignature0
- true = external signing, false = internal
signingSMIMEException
- 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 CMSEnvelopedObject constructor.Method Detail |
public void setCapabilities(java.lang.String type0, int par10, int par20, int par30, int par40, int par50) throws SMIMEException
type0
- sets group of algorithms for capabilities attributes. It can be set
with values: SIGNATURE, SYMMETRIC, ENCIPHER or DEFAULT.par10
- sets order in group of parameters, or exclude some algorithms
from capabilities atributes. Can take values 1, 2, 3, 4 or 5 and 0 for
exclusion of the particular algorithm.par20
- same as for par10par30
- same as for par10par40
- same as for par10par50
- same as for par10SMIMEException
- if method is performed more than three times for one signer,
or in case of wrong values of parameters.public void addSigner(java.security.KeyStore pfx0, boolean includingCert0, boolean includingSignAttrib0, java.lang.String signingAlg0) throws SMIMEException
pfx0
- contains information from signer's .pfx or .p12 fileincludingCert0
- true = automatically including all certificates from pfx0
false = no certificate will be addedincludingSignAttrib0
- true = signed attributes will be included, false
= signed attributes will not be includedsigningAlg0
- used for signing (can be SHA1_WITH_RSA, MD2_WITH_RSA,
MD5_WITH_RSA or SHA1_WITH_DSA)SMIMEException
- in case of wrong type of digest algorithm, or in
case of problems with manipulation with .pfx or .p12 file in PFXUtils class.
Also, it can be caused by problems in construction or work with some inner
objects from org.webdocwf.util.smime.der or org.webdocwf.util.smime.cms package.public void addSigner(java.security.cert.X509Certificate[] chain0, java.security.PrivateKey privKey0, boolean includingCert0, boolean includingSignAttrib0, java.lang.String signingAlg0) throws SMIMEException
chain0
- signer's certificates chain. First certificate in chain
must be owner's.privKey0
- signer's private key (DSA or RSA depend on type of signing)includingCert0
- true = automatically including all certificates from pfx0
false = no certificate will be addedincludingSignAttrib0
- true = signed attributes will be included, false
= signed attributes will not be includedsigningAlg0
- used for signing (can be SHA1_WITH_RSA, MD2_WITH_RSA,
MD5_WITH_RSA or SHA1_WITH_DSA)SMIMEException
- in case of wrong type of digest algorithm. Also,
it can be caused by problems in construction or work with some inner
objects from org.webdocwf.util.smime.der or org.webdocwf.util.smime.cms package.public void addCertificate(java.security.cert.X509Certificate cert0) throws SMIMEException
cert0
- X509 certificateSMIMEException
- thrown in inner object which is instance of the class
org.webdocwf.util.smime.cms.Certificates.public byte[] getCMSSignedObject() throws SMIMEException
SMIMEException
- caused by problems in construction or dealing
with some inner objects instantiated from classes that belong to
org.webdocwf.util.smime.der or org.webdocwf.util.smime.cms packages.public byte[] getBASE64CMSSignedObject() throws SMIMEException
SMIMEException
- in case of failure in Base64 encoding performed
on the generated SMIME message byte array by method ofMimeAssist 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 getCMSSignedDataSource() 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 |