java.lang.Object | |
↳ | org.bouncycastle.cms.CMSSignedData |
Known Direct Subclasses |
general class for handling a pkcs7-signature message. A simple example of usage - note, in the example below the validity of the certificate isn't verified, just the fact that one of the certs matches the given signer...
CertStore certs = s.getCertificatesAndCRLs("Collection", "BC"); SignerInformationStore signers = s.getSignerInfos(); Collection c = signers.getSigners(); Iterator it = c.iterator(); while (it.hasNext()) { SignerInformation signer = (SignerInformation)it.next(); Collection certCollection = certStore.getMatches(signer.getSID()); Iterator certIt = certCollection.iterator(); X509CertificateHolder cert = (X509CertificateHolder)certIt.next(); if (signer.verify(new JcaSimpleSignerInfoVerifierBuilder().setProvider("BC").build(cert))) { verified++; } }
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Content with detached signature, digests precomputed
| |||||||||||
base constructor - content with detached signature.
| |||||||||||
base constructor - with encapsulated content
| |||||||||||
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
This method is deprecated.
use base Store returning method
| |||||||||||
return the ContentInfo
| |||||||||||
return the ASN.1 encoded representation of this object.
| |||||||||||
Return the a string representation of the OID associated with the
encapsulated content info structure carried in the signed data.
| |||||||||||
return the collection of signers that are associated with the
signatures for the message.
| |||||||||||
Return the version number for this object
| |||||||||||
Replace the certificate and CRL information associated with this
CMSSignedData object with the new one passed in.
| |||||||||||
Replace the certificate and CRL information associated with this
CMSSignedData object with the new one passed in.
| |||||||||||
Replace the signerinformation store associated with this
CMSSignedData object with the new one passed in.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Content with detached signature, digests precomputed
hashes | a map of precomputed digests for content indexed by name of hash. |
---|---|
sigBlock | the signature object. |
CMSException |
---|
base constructor - content with detached signature.
signedContent | the content that was signed. |
---|---|
sigData | the signature object. |
CMSException |
---|
base constructor - with encapsulated content
CMSException |
---|
This method is deprecated.
use base Store returning method
return a X509Store containing the attribute certificates, if any, contained in this message.
type | type of store to create |
---|---|
provider | name of provider to use |
NoSuchProviderException | if the provider requested isn't available. |
---|---|
NoSuchStoreException | if the store type isn't available. |
CMSException | if a general exception prevents creation of the X509Store |
This method is deprecated.
use base Store returning method
return a X509Store containing the attribute certificates, if any, contained in this message.
type | type of store to create |
---|---|
provider | provider to use |
NoSuchStoreException | if the store type isn't available. |
---|---|
CMSException | if a general exception prevents creation of the X509Store |
This method is deprecated.
use base Store returning method
return a X509Store containing CRLs, if any, contained in this message.
type | type of store to create |
---|---|
provider | provider to use |
NoSuchStoreException | if the store type isn't available. |
---|---|
CMSException | if a general exception prevents creation of the X509Store |
This method is deprecated.
use base Store returning method
return a X509Store containing CRLs, if any, contained in this message.
type | type of store to create |
---|---|
provider | name of provider to use |
NoSuchProviderException | if the provider requested isn't available. |
---|---|
NoSuchStoreException | if the store type isn't available. |
CMSException | if a general exception prevents creation of the X509Store |
This method is deprecated.
use base Store returning method
return a X509Store containing the public key certificates, if any, contained in this message.
type | type of store to create |
---|---|
provider | provider to use |
NoSuchStoreException | if the store type isn't available. |
---|---|
CMSException | if a general exception prevents creation of the X509Store |
This method is deprecated.
use base Store returning method
return a X509Store containing the public key certificates, if any, contained in this message.
type | type of store to create |
---|---|
provider | name of provider to use |
NoSuchProviderException | if the provider requested isn't available. |
---|---|
NoSuchStoreException | if the store type isn't available. |
CMSException | if a general exception prevents creation of the X509Store |
This method is deprecated.
use base Store returning method
return a CertStore containing the certificates and CRLs associated with this message.
NoSuchAlgorithmException | if the cert store isn't available. |
---|---|
CMSException | if a general exception prevents creation of the CertStore |
This method is deprecated.
use base Store returning method
return a CertStore containing the certificates and CRLs associated with this message.
NoSuchProviderException | if the provider requested isn't available. |
---|---|
NoSuchAlgorithmException | if the cert store isn't available. |
CMSException | if a general exception prevents creation of the CertStore |
return the ContentInfo
return the ASN.1 encoded representation of this object.
IOException |
---|
Return the a string representation of the OID associated with the encapsulated content info structure carried in the signed data.
return the collection of signers that are associated with the signatures for the message.
Return the version number for this object
Replace the certificate and CRL information associated with this CMSSignedData object with the new one passed in.
signedData | the signed data object to be used as a base. |
---|---|
certificates | the new certificates to be used. |
attrCerts | the new attribute certificates to be used. |
crls | the new CRLs to be used. |
CMSException | if there is an error processing the CertStore |
---|
Replace the certificate and CRL information associated with this CMSSignedData object with the new one passed in.
signedData | the signed data object to be used as a base. |
---|---|
certsAndCrls | the new certificates and CRLs to be used. |
CMSException | if there is an error processing the CertStore |
---|
Replace the signerinformation store associated with this CMSSignedData object with the new one passed in. You would probably only want to do this if you wanted to change the unsigned attributes associated with a signer, or perhaps delete one.
signedData | the signed data object to be used as a base. |
---|---|
signerInformationStore | the new signer information store to use. |