Package eu.europa.esig.dss.cms.stream
Class CMSSignedContentDocument
java.lang.Object
eu.europa.esig.dss.model.CommonDocument
eu.europa.esig.dss.cms.stream.CMSSignedContentDocument
- All Implemented Interfaces:
DSSDocument
,Serializable
This class is used to extract a wrapped signed content from a CMS document.
The class allows providing digest in order to avoid reading the document.
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.model.CommonDocument
digestMap, mimeType, name
-
Constructor Summary
ConstructorsConstructorDescriptionCMSSignedContentDocument
(DSSDocument cmsDocument) Constructor with a null signed content typeCMSSignedContentDocument
(DSSDocument cmsDocument, org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType) Constructor with a provided signed content type -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method allows to add aDigest
with a new digest algorithm to the current DigestDocument.boolean
int
hashCode()
Opens aInputStream
on theDSSDocument
contents.void
Save the content of the DSSDocument to the file.org.bouncycastle.cms.CMSTypedData
Returns aCMSTypedData
for a signature creationMethods inherited from class eu.europa.esig.dss.model.CommonDocument
getDigest, getDigestValue, getMimeType, getName, setMimeType, setName, toString, writeTo
-
Constructor Details
-
CMSSignedContentDocument
Constructor with a null signed content type- Parameters:
cmsDocument
-DSSDocument
representing the CMS document
-
CMSSignedContentDocument
public CMSSignedContentDocument(DSSDocument cmsDocument, org.bouncycastle.asn1.ASN1ObjectIdentifier signedContentType) Constructor with a provided signed content type- Parameters:
cmsDocument
-DSSDocument
representing the CMS documentsignedContentType
-ASN1ObjectIdentifier
-
-
Method Details
-
openStream
Description copied from interface:DSSDocument
Opens aInputStream
on theDSSDocument
contents. The type of theInputStream
depends on the type of theDSSDocument
.- Returns:
- an
InputStream
-
toCMSTypedData
public org.bouncycastle.cms.CMSTypedData toCMSTypedData()Returns aCMSTypedData
for a signature creation- Returns:
CMSTypedData
-
addDigest
This method allows to add aDigest
with a new digest algorithm to the current DigestDocument. Overwrites the previous digest if the same DigestAlgorithm is provided.- Parameters:
digest
-Digest
for the current document
-
save
Description copied from interface:DSSDocument
Save the content of the DSSDocument to the file.- Specified by:
save
in interfaceDSSDocument
- Overrides:
save
in classCommonDocument
- Parameters:
filePath
- the path to the file to be created- Throws:
IOException
- if any IO error happens
-
equals
- Overrides:
equals
in classCommonDocument
-
hashCode
public int hashCode()- Overrides:
hashCode
in classCommonDocument
-