Package eu.europa.esig.dss.cms.stream
Class CMSSignedDataStream
java.lang.Object
eu.europa.esig.dss.cms.stream.CMSSignedDataStream
- All Implemented Interfaces:
CMS
Implementation of a
CMS
based on a parsed content.-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor to create an empty instance on CMS creationConstructor to create a copy ofcms
CMSSignedDataStream
(DSSDocument cmsDocument) This constructor is used to create an instance ofCMSSignedDataStream
on parsing of an existing CMS document -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.util.Store
<org.bouncycastle.cert.X509AttributeCertificateHolder> Gets attribute certificates incorporates within CMSorg.bouncycastle.util.Store
<org.bouncycastle.cert.X509CertificateHolder> Gets the certificates store, representing the value of SignedData.certificates fieldGets the original CMS document used to create the CMSorg.bouncycastle.util.Store
<org.bouncycastle.cert.X509CRLHolder> getCRLs()
Gets the CRLs store (OCSP excluded), representing the value of SignedData.crls fieldbyte[]
Gets DER-encoded content of the CMS SignedData.Set
<org.bouncycastle.asn1.x509.AlgorithmIdentifier> Returns a set of algorithm identifiers (OIDs) incorporated within SignedData.digestAlgorithms field of CMSbyte[]
Gets encoded content of the CMS SignedData, keeping the original encoding.org.bouncycastle.util.Store
<?> Gets the OCSP Basic Store, incorporated within the SignedData.crls fieldorg.bouncycastle.util.Store
<?> Gets the OCSP Responses Store, incorporated within the SignedData.crls fieldGets the signed content incorporated within the SignedData.encapContentInfo.eContent fieldorg.bouncycastle.asn1.ASN1ObjectIdentifier
Gets signed content type, present within the SignedData.encapContentInfo.eContentType fieldorg.bouncycastle.cms.SignerInformationStore
Gets the signers of the signature, incorporated within the SignedData.signerInfos fieldint
Returns value of SignedData.version fieldboolean
Returns whether the signature is detached (i.e.void
setAttributeCertificates
(org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates) Sets attribute certificates incorporates within CMSvoid
setCertificates
(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificates) Sets the certificates store, representing the value of SignedData.certificates fieldvoid
setCRLs
(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls) Sets the CRLs store (OCSP excluded), representing the value of SignedData.crls fieldvoid
setDetachedSignature
(boolean detachedSignature) Sets whether the signature is detached (i.e.void
setDigestAlgorithmIDs
(Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmIDs) Sets a set of algorithm identifiers (OIDs) incorporated within SignedData.digestAlgorithms field of CMSvoid
setOcspBasicStore
(org.bouncycastle.util.Store<?> ocspBasicStore) Sets the OCSP Basic Store, incorporated within the SignedData.crls fieldvoid
setOcspResponseStore
(org.bouncycastle.util.Store<?> ocspResponseStore) Sets the OCSP Responses Store, incorporated within the SignedData.crls fieldvoid
setSignedContent
(DSSDocument signedContent) Sets the signed content incorporated within the SignedData.encapContentInfo.eContent fieldvoid
setSignedContentType
(org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType) Sets signed content type, present within the SignedData.encapContentInfo.eContentType fieldvoid
setSignerInfos
(org.bouncycastle.cms.SignerInformationStore signerInfos) Sets the signers of the signature, incorporated within the SignedData.signerInfos fieldvoid
setVersion
(int version) Sets value of SignedData.version field
-
Constructor Details
-
CMSSignedDataStream
public CMSSignedDataStream()Default constructor to create an empty instance on CMS creation -
CMSSignedDataStream
Constructor to create a copy ofcms
- Parameters:
cms
-CMSSignedDataStream
-
CMSSignedDataStream
This constructor is used to create an instance ofCMSSignedDataStream
on parsing of an existing CMS document- Parameters:
cmsDocument
-DSSDocument
original document provided on parsing
-
-
Method Details
-
getCMSDocument
Gets the original CMS document used to create the CMS- Returns:
DSSDocument
-
getVersion
public int getVersion()Description copied from interface:CMS
Returns value of SignedData.version field- Specified by:
getVersion
in interfaceCMS
- Returns:
- integer value
-
setVersion
public void setVersion(int version) Sets value of SignedData.version field- Parameters:
version
- integer value
-
getDigestAlgorithmIDs
Description copied from interface:CMS
Returns a set of algorithm identifiers (OIDs) incorporated within SignedData.digestAlgorithms field of CMS- Specified by:
getDigestAlgorithmIDs
in interfaceCMS
- Returns:
- a set of
AlgorithmIdentifier
s
-
setDigestAlgorithmIDs
public void setDigestAlgorithmIDs(Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmIDs) Sets a set of algorithm identifiers (OIDs) incorporated within SignedData.digestAlgorithms field of CMS- Parameters:
digestAlgorithmIDs
- a collection ofAlgorithmIdentifier
s
-
isDetachedSignature
public boolean isDetachedSignature()Description copied from interface:CMS
Returns whether the signature is detached (i.e. SignedData.encapContentInfo.eContent is null)- Specified by:
isDetachedSignature
in interfaceCMS
- Returns:
- whether the signature is detached
-
setDetachedSignature
public void setDetachedSignature(boolean detachedSignature) Sets whether the signature is detached (i.e. SignedData.encapContentInfo.eContent is null)- Parameters:
detachedSignature
- whether the signature is detached
-
getSignedContentType
public org.bouncycastle.asn1.ASN1ObjectIdentifier getSignedContentType()Description copied from interface:CMS
Gets signed content type, present within the SignedData.encapContentInfo.eContentType field- Specified by:
getSignedContentType
in interfaceCMS
- Returns:
ASN1ObjectIdentifier
-
setSignedContentType
public void setSignedContentType(org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType) Sets signed content type, present within the SignedData.encapContentInfo.eContentType field- Parameters:
signedContentType
-ASN1ObjectIdentifier
-
getSignedContent
Description copied from interface:CMS
Gets the signed content incorporated within the SignedData.encapContentInfo.eContent field- Specified by:
getSignedContent
in interfaceCMS
- Returns:
DSSDocument
-
setSignedContent
Sets the signed content incorporated within the SignedData.encapContentInfo.eContent field- Parameters:
signedContent
-DSSDocument
-
getCertificates
public org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> getCertificates()Description copied from interface:CMS
Gets the certificates store, representing the value of SignedData.certificates field- Specified by:
getCertificates
in interfaceCMS
- Returns:
Store
-
setCertificates
public void setCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificates) Sets the certificates store, representing the value of SignedData.certificates field- Parameters:
certificates
-Store
-
getAttributeCertificates
public org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> getAttributeCertificates()Description copied from interface:CMS
Gets attribute certificates incorporates within CMS- Specified by:
getAttributeCertificates
in interfaceCMS
- Returns:
Store
-
setAttributeCertificates
public void setAttributeCertificates(org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates) Sets attribute certificates incorporates within CMS- Parameters:
attributeCertificates
-Store
-
getCRLs
public org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> getCRLs()Description copied from interface:CMS
Gets the CRLs store (OCSP excluded), representing the value of SignedData.crls field -
setCRLs
public void setCRLs(org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls) Sets the CRLs store (OCSP excluded), representing the value of SignedData.crls field- Parameters:
crls
-Store
-
getOcspResponseStore
public org.bouncycastle.util.Store<?> getOcspResponseStore()Description copied from interface:CMS
Gets the OCSP Responses Store, incorporated within the SignedData.crls field- Specified by:
getOcspResponseStore
in interfaceCMS
- Returns:
Store
-
setOcspResponseStore
public void setOcspResponseStore(org.bouncycastle.util.Store<?> ocspResponseStore) Sets the OCSP Responses Store, incorporated within the SignedData.crls field- Parameters:
ocspResponseStore
-Store
-
getOcspBasicStore
public org.bouncycastle.util.Store<?> getOcspBasicStore()Description copied from interface:CMS
Gets the OCSP Basic Store, incorporated within the SignedData.crls field- Specified by:
getOcspBasicStore
in interfaceCMS
- Returns:
Store
-
setOcspBasicStore
public void setOcspBasicStore(org.bouncycastle.util.Store<?> ocspBasicStore) Sets the OCSP Basic Store, incorporated within the SignedData.crls field- Parameters:
ocspBasicStore
-Store
-
getSignerInfos
public org.bouncycastle.cms.SignerInformationStore getSignerInfos()Description copied from interface:CMS
Gets the signers of the signature, incorporated within the SignedData.signerInfos field- Specified by:
getSignerInfos
in interfaceCMS
- Returns:
SignerInformationStore
-
setSignerInfos
public void setSignerInfos(org.bouncycastle.cms.SignerInformationStore signerInfos) Sets the signers of the signature, incorporated within the SignedData.signerInfos field- Parameters:
signerInfos
-SignerInformationStore
-
getDEREncoded
public byte[] getDEREncoded()Description copied from interface:CMS
Gets DER-encoded content of the CMS SignedData. NOTE: This method returns the encoded value using in-memory byte array. Not applicable for large CMS processing.- Specified by:
getDEREncoded
in interfaceCMS
- Returns:
- DER-encoded binaries
-
getEncoded
public byte[] getEncoded()Description copied from interface:CMS
Gets encoded content of the CMS SignedData, keeping the original encoding.- Specified by:
getEncoded
in interfaceCMS
- Returns:
- encoded binaries
-