Class CMSStreamUtils
java.lang.Object
eu.europa.esig.dss.cms.stream.CMSStreamUtils
CMS Utils using a stream processing of a CMS SignedData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcreateCopy(eu.europa.esig.dss.cms.CMS cms) Creates a copy of theCMSobjectgetContentInfoEncoding(eu.europa.esig.dss.cms.CMS cms) eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuildergetDSSResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder dssResourcesHandlerBuilder) eu.europa.esig.dss.cms.CMSparseToCMS(byte[] binaries) eu.europa.esig.dss.cms.CMSparseToCMS(eu.europa.esig.dss.model.DSSDocument document) eu.europa.esig.dss.cms.CMSpopulateDigestAlgorithmSet(eu.europa.esig.dss.cms.CMS cms, Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmsToAdd) org.bouncycastle.cms.SignerInformationrecomputeSignerInformation(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerId signerId, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider, eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder) eu.europa.esig.dss.cms.CMSreplaceCertificatesAndCRLs(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificates, org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates, org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls, org.bouncycastle.util.Store<?> ocspResponsesStore, org.bouncycastle.util.Store<?> ocspBasicStore) eu.europa.esig.dss.cms.CMSreplaceSigners(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformationStore newSignerStore) org.bouncycastle.cms.SignerInformationreplaceUnsignedAttributes(org.bouncycastle.cms.SignerInformation signerInformation, org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes) eu.europa.esig.dss.cms.CMStoCMS(org.bouncycastle.tsp.TimeStampToken timeStampToken) org.bouncycastle.cms.CMSTypedDatatoCMSEncapsulatedContent(eu.europa.esig.dss.model.DSSDocument document) voidwriteContentInfoEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) voidwriteSignedDataCertificatesEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) voidwriteSignedDataCRLsEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) voidwriteSignedDataDigestAlgorithmsEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) Writes the encoded binaries of the SignedData.digestAlgorithms field to the givenOutputStreamNOTE: This method is used for evidence record hash computationvoidwriteSignedDataSignerInfosEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) Writes the encoded binaries of the SignedData.signerInfos field to the givenOutputStreamNOTE: This method is used for evidence record hash computationeu.europa.esig.dss.model.DSSDocumentwriteToDSSDocument(eu.europa.esig.dss.cms.CMS cms, eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder)
-
Constructor Details
-
CMSStreamUtils
public CMSStreamUtils()Default constructor
-
-
Method Details
-
parseToCMS
public eu.europa.esig.dss.cms.CMS parseToCMS(eu.europa.esig.dss.model.DSSDocument document) -
parseToCMS
public eu.europa.esig.dss.cms.CMS parseToCMS(byte[] binaries) -
writeToDSSDocument
public eu.europa.esig.dss.model.DSSDocument writeToDSSDocument(eu.europa.esig.dss.cms.CMS cms, eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder) -
recomputeSignerInformation
public org.bouncycastle.cms.SignerInformation recomputeSignerInformation(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerId signerId, org.bouncycastle.operator.DigestCalculatorProvider digestCalculatorProvider, eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder resourcesHandlerBuilder) throws org.bouncycastle.cms.CMSException - Throws:
org.bouncycastle.cms.CMSException
-
replaceSigners
public eu.europa.esig.dss.cms.CMS replaceSigners(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.cms.SignerInformationStore newSignerStore) -
replaceCertificatesAndCRLs
public eu.europa.esig.dss.cms.CMS replaceCertificatesAndCRLs(eu.europa.esig.dss.cms.CMS cms, org.bouncycastle.util.Store<org.bouncycastle.cert.X509CertificateHolder> certificates, org.bouncycastle.util.Store<org.bouncycastle.cert.X509AttributeCertificateHolder> attributeCertificates, org.bouncycastle.util.Store<org.bouncycastle.cert.X509CRLHolder> crls, org.bouncycastle.util.Store<?> ocspResponsesStore, org.bouncycastle.util.Store<?> ocspBasicStore) -
populateDigestAlgorithmSet
public eu.europa.esig.dss.cms.CMS populateDigestAlgorithmSet(eu.europa.esig.dss.cms.CMS cms, Collection<org.bouncycastle.asn1.x509.AlgorithmIdentifier> digestAlgorithmsToAdd) -
createCopy
Creates a copy of theCMSobject- Parameters:
cms-CMS- Returns:
CMS
-
toCMS
public eu.europa.esig.dss.cms.CMS toCMS(org.bouncycastle.tsp.TimeStampToken timeStampToken) -
getContentInfoEncoding
-
writeSignedDataDigestAlgorithmsEncoded
public void writeSignedDataDigestAlgorithmsEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) throws IOException Writes the encoded binaries of the SignedData.digestAlgorithms field to the givenOutputStreamNOTE: This method is used for evidence record hash computation- Parameters:
cms-CMSos-OutputStream- Throws:
IOException- if an exception occurs on bytes writing
-
writeContentInfoEncoded
public void writeContentInfoEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) throws IOException - Throws:
IOException
-
writeSignedDataCertificatesEncoded
public void writeSignedDataCertificatesEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) throws IOException - Throws:
IOException
-
writeSignedDataCRLsEncoded
public void writeSignedDataCRLsEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) throws IOException - Throws:
IOException
-
writeSignedDataSignerInfosEncoded
public void writeSignedDataSignerInfosEncoded(eu.europa.esig.dss.cms.CMS cms, OutputStream os) throws IOException Writes the encoded binaries of the SignedData.signerInfos field to the givenOutputStreamNOTE: This method is used for evidence record hash computation- Parameters:
cms-CMSos-OutputStream- Throws:
IOException- if an exception occurs on bytes writing
-
toCMSEncapsulatedContent
public org.bouncycastle.cms.CMSTypedData toCMSEncapsulatedContent(eu.europa.esig.dss.model.DSSDocument document) -
getDSSResourcesHandlerBuilder
public eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder getDSSResourcesHandlerBuilder(eu.europa.esig.dss.spi.signature.resources.DSSResourcesHandlerBuilder dssResourcesHandlerBuilder) -
replaceUnsignedAttributes
public org.bouncycastle.cms.SignerInformation replaceUnsignedAttributes(org.bouncycastle.cms.SignerInformation signerInformation, org.bouncycastle.asn1.cms.AttributeTable unsignedAttributes) -
assertATSv2AugmentationSupported
public void assertATSv2AugmentationSupported() -
assertEvidenceRecordEmbeddingSupported
public void assertEvidenceRecordEmbeddingSupported()
-