public class CMSSignedData extends Object
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++;
}
}
| Constructor and Description |
|---|
CMSSignedData(byte[] sigBlock) |
CMSSignedData(CMSProcessable signedContent,
byte[] sigBlock) |
CMSSignedData(CMSProcessable signedContent,
org.bouncycastle.asn1.cms.ContentInfo sigData) |
CMSSignedData(CMSProcessable signedContent,
InputStream sigData)
base constructor - content with detached signature.
|
CMSSignedData(org.bouncycastle.asn1.cms.ContentInfo sigData) |
CMSSignedData(InputStream sigData)
base constructor - with encapsulated content
|
CMSSignedData(Map hashes,
byte[] sigBlock)
Content with detached signature, digests precomputed
|
CMSSignedData(Map hashes,
org.bouncycastle.asn1.cms.ContentInfo sigData) |
| Modifier and Type | Method and Description |
|---|---|
org.bouncycastle.util.Store |
getAttributeCertificates() |
org.bouncycastle.x509.X509Store |
getAttributeCertificates(String type,
Provider provider)
Deprecated.
use base Store returning method
|
org.bouncycastle.x509.X509Store |
getAttributeCertificates(String type,
String provider)
Deprecated.
use base Store returning method
|
org.bouncycastle.util.Store |
getCertificates() |
org.bouncycastle.x509.X509Store |
getCertificates(String type,
Provider provider)
Deprecated.
use base Store returning method
|
org.bouncycastle.x509.X509Store |
getCertificates(String type,
String provider)
Deprecated.
use base Store returning method
|
CertStore |
getCertificatesAndCRLs(String type,
Provider provider)
Deprecated.
use base Store returning method
|
CertStore |
getCertificatesAndCRLs(String type,
String provider)
Deprecated.
use base Store returning method
|
org.bouncycastle.asn1.cms.ContentInfo |
getContentInfo()
return the ContentInfo
|
org.bouncycastle.util.Store |
getCRLs() |
org.bouncycastle.x509.X509Store |
getCRLs(String type,
Provider provider)
Deprecated.
use base Store returning method
|
org.bouncycastle.x509.X509Store |
getCRLs(String type,
String provider)
Deprecated.
use base Store returning method
|
byte[] |
getEncoded()
return the ASN.1 encoded representation of this object.
|
CMSProcessable |
getSignedContent() |
String |
getSignedContentTypeOID()
Return the a string representation of the OID associated with the
encapsulated content info structure carried in the signed data.
|
SignerInformationStore |
getSignerInfos()
return the collection of signers that are associated with the
signatures for the message.
|
int |
getVersion()
Return the version number for this object
|
static CMSSignedData |
replaceCertificatesAndCRLs(CMSSignedData signedData,
CertStore certsAndCrls)
Replace the certificate and CRL information associated with this
CMSSignedData object with the new one passed in.
|
static CMSSignedData |
replaceCertificatesAndCRLs(CMSSignedData signedData,
org.bouncycastle.util.Store certificates,
org.bouncycastle.util.Store attrCerts,
org.bouncycastle.util.Store crls)
Replace the certificate and CRL information associated with this
CMSSignedData object with the new one passed in.
|
static CMSSignedData |
replaceSigners(CMSSignedData signedData,
SignerInformationStore signerInformationStore)
Replace the signerinformation store associated with this
CMSSignedData object with the new one passed in.
|
public CMSSignedData(byte[] sigBlock)
throws CMSException
CMSExceptionpublic CMSSignedData(CMSProcessable signedContent, byte[] sigBlock) throws CMSException
CMSExceptionpublic CMSSignedData(Map hashes, byte[] sigBlock) throws CMSException
hashes - a map of precomputed digests for content indexed by name of hash.sigBlock - the signature object.CMSExceptionpublic CMSSignedData(CMSProcessable signedContent, InputStream sigData) throws CMSException
signedContent - the content that was signed.sigData - the signature object.CMSExceptionpublic CMSSignedData(InputStream sigData) throws CMSException
CMSExceptionpublic CMSSignedData(CMSProcessable signedContent, org.bouncycastle.asn1.cms.ContentInfo sigData)
public CMSSignedData(Map hashes, org.bouncycastle.asn1.cms.ContentInfo sigData)
public CMSSignedData(org.bouncycastle.asn1.cms.ContentInfo sigData)
public int getVersion()
public SignerInformationStore getSignerInfos()
public org.bouncycastle.x509.X509Store getAttributeCertificates(String type, String provider) throws org.bouncycastle.x509.NoSuchStoreException, NoSuchProviderException, CMSException
type - type of store to createprovider - name of provider to useNoSuchProviderException - if the provider requested isn't available.org.bouncycastle.x509.NoSuchStoreException - if the store type isn't available.CMSException - if a general exception prevents creation of the X509Storepublic org.bouncycastle.x509.X509Store getAttributeCertificates(String type, Provider provider) throws org.bouncycastle.x509.NoSuchStoreException, CMSException
type - type of store to createprovider - provider to useorg.bouncycastle.x509.NoSuchStoreException - if the store type isn't available.CMSException - if a general exception prevents creation of the X509Storepublic org.bouncycastle.x509.X509Store getCertificates(String type, String provider) throws org.bouncycastle.x509.NoSuchStoreException, NoSuchProviderException, CMSException
type - type of store to createprovider - name of provider to useNoSuchProviderException - if the provider requested isn't available.org.bouncycastle.x509.NoSuchStoreException - if the store type isn't available.CMSException - if a general exception prevents creation of the X509Storepublic org.bouncycastle.x509.X509Store getCertificates(String type, Provider provider) throws org.bouncycastle.x509.NoSuchStoreException, CMSException
type - type of store to createprovider - provider to useorg.bouncycastle.x509.NoSuchStoreException - if the store type isn't available.CMSException - if a general exception prevents creation of the X509Storepublic org.bouncycastle.x509.X509Store getCRLs(String type, String provider) throws org.bouncycastle.x509.NoSuchStoreException, NoSuchProviderException, CMSException
type - type of store to createprovider - name of provider to useNoSuchProviderException - if the provider requested isn't available.org.bouncycastle.x509.NoSuchStoreException - if the store type isn't available.CMSException - if a general exception prevents creation of the X509Storepublic org.bouncycastle.x509.X509Store getCRLs(String type, Provider provider) throws org.bouncycastle.x509.NoSuchStoreException, CMSException
type - type of store to createprovider - provider to useorg.bouncycastle.x509.NoSuchStoreException - if the store type isn't available.CMSException - if a general exception prevents creation of the X509Storepublic CertStore getCertificatesAndCRLs(String type, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, CMSException
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 CertStorepublic CertStore getCertificatesAndCRLs(String type, Provider provider) throws NoSuchAlgorithmException, CMSException
NoSuchAlgorithmException - if the cert store isn't available.CMSException - if a general exception prevents creation of the CertStorepublic org.bouncycastle.util.Store getCertificates()
public org.bouncycastle.util.Store getCRLs()
public org.bouncycastle.util.Store getAttributeCertificates()
public String getSignedContentTypeOID()
public CMSProcessable getSignedContent()
public org.bouncycastle.asn1.cms.ContentInfo getContentInfo()
public byte[] getEncoded()
throws IOException
IOExceptionpublic static CMSSignedData replaceSigners(CMSSignedData signedData, SignerInformationStore signerInformationStore)
signedData - the signed data object to be used as a base.signerInformationStore - the new signer information store to use.public static CMSSignedData replaceCertificatesAndCRLs(CMSSignedData signedData, CertStore certsAndCrls) throws CMSException
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 CertStorepublic static CMSSignedData replaceCertificatesAndCRLs(CMSSignedData signedData, org.bouncycastle.util.Store certificates, org.bouncycastle.util.Store attrCerts, org.bouncycastle.util.Store crls) throws CMSException
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 CertStoreCopyright © 2014. All rights reserved.