iText 8.0.4 API
iText.Signatures.Cms.CMSContainer Class Reference

The CMS container which represents SignedData structure from rfc5652 Cryptographic Message Syntax (CMS) More...

Public Member Functions

  CMSContainer ()
  Creates an empty SignedData structure. More...
 
  CMSContainer (byte[] encodedCMSdata)
  Creates a SignedData structure from a serialized ASN1 structure. More...
 
virtual void  SetSignerInfo (SignerInfo signerInfo)
  This class only supports one signer per signature field. More...
 
virtual SignerInfo  GetSignerInfo ()
  This class only supports one signer per signature field. More...
 
virtual long  GetSizeEstimation ()
  When all fields except for signer.signedAttributes.digest and signer.signature are completed it is possible to calculate the eventual size of the signature by serializing except for the signature (that depends on the digest and cypher but is set at 1024 bytes) and later added unsigned attributes like timestamps. More...
 
virtual int  GetCmsVersion ()
  Only version 1 is supported by this class. More...
 
virtual AlgorithmIdentifier  GetDigestAlgorithm ()
  The digest algorithm OID and parameters used by the signer. More...
 
virtual EncapsulatedContentInfo  GetEncapContentInfo ()
  This represents the signed content. More...
 
virtual void  SetEncapContentInfo (EncapsulatedContentInfo encapContentInfo)
  This represents the signed content. More...
 
virtual void  AddCertificate (IX509Certificate cert)
  Adds a certificate. More...
 
virtual void  AddCertificates (IX509Certificate[] certs)
  Adds a set of certificates. More...
 
virtual ICollection< IX509Certificate GetCertificates ()
  Retrieves a copy of the list of certificates. More...
 
virtual ICollection< IX509Crl GetCrls ()
  Retrieves a copy of the list of CRLs. More...
 
virtual void  AddCrl (IX509Crl crl)
  Adds a CRL response to the CMS container. More...
 
virtual ICollection< IBasicOcspResponse GetOcsps ()
  Retrieves a copy of the list of OCSPs. More...
 
virtual void  AddOcsp (IBasicOcspResponse ocspResponse)
  Adds an OCSP response to the CMS container. More...
 
virtual void  SetSerializedSignedAttributes (byte[] signedAttributesData)
  Sets the Signed Attributes of the signer info to this serialized version. More...
 
virtual byte[]  GetSerializedSignedAttributes ()
  Retrieves the encoded signed attributes of the signer info. More...
 
virtual byte[]  Serialize ()
  Serializes the SignedData structure and makes the signer infos signed attributes read only. More...
 

Detailed Description

The CMS container which represents SignedData structure from rfc5652 Cryptographic Message Syntax (CMS)

Constructor & Destructor Documentation

◆ CMSContainer() [1/2]

iText.Signatures.Cms.CMSContainer.CMSContainer ( )
inline

Creates an empty SignedData structure.

◆ CMSContainer() [2/2]

iText.Signatures.Cms.CMSContainer.CMSContainer ( byte[]  encodedCMSdata )
inline

Creates a SignedData structure from a serialized ASN1 structure.

Parameters
encodedCMSdata the serialized CMS container

Member Function Documentation

◆ AddCertificate()

virtual void iText.Signatures.Cms.CMSContainer.AddCertificate ( IX509Certificate  cert )
inlinevirtual

Adds a certificate.

Parameters
cert the certificate to be added

◆ AddCertificates()

virtual void iText.Signatures.Cms.CMSContainer.AddCertificates ( IX509Certificate[]  certs )
inlinevirtual

Adds a set of certificates.

Parameters
certs the certificates to be added

◆ AddCrl()

virtual void iText.Signatures.Cms.CMSContainer.AddCrl ( IX509Crl  crl )
inlinevirtual

Adds a CRL response to the CMS container.

Parameters
crl the CRL response to be added.

◆ AddOcsp()

virtual void iText.Signatures.Cms.CMSContainer.AddOcsp ( IBasicOcspResponse  ocspResponse )
inlinevirtual

Adds an OCSP response to the CMS container.

Parameters
ocspResponse the OCSP response to be added.

◆ GetCertificates()

virtual ICollection<IX509Certificate> iText.Signatures.Cms.CMSContainer.GetCertificates ( )
inlinevirtual

Retrieves a copy of the list of certificates.

Returns
the list of certificates to be used for signing and certificate validation

◆ GetCmsVersion()

virtual int iText.Signatures.Cms.CMSContainer.GetCmsVersion ( )
inlinevirtual

Only version 1 is supported by this class.

Returns
1 as CMSversion

◆ GetCrls()

virtual ICollection<IX509Crl> iText.Signatures.Cms.CMSContainer.GetCrls ( )
inlinevirtual

Retrieves a copy of the list of CRLs.

Returns
the list of CRL revocation info.

◆ GetDigestAlgorithm()

virtual AlgorithmIdentifier iText.Signatures.Cms.CMSContainer.GetDigestAlgorithm ( )
inlinevirtual

The digest algorithm OID and parameters used by the signer.

The digest algorithm OID and parameters used by the signer. This class only supports one signer for use in pdf signatures, so only one digest algorithm is supported.

This field is set when adding the signerInfo.

Returns

AlgorithmIdentifier digest algorithm.

◆ GetEncapContentInfo()

virtual EncapsulatedContentInfo iText.Signatures.Cms.CMSContainer.GetEncapContentInfo ( )
inlinevirtual

This represents the signed content.

This represents the signed content. In the case of a signed PDF document this will be of type data with no content.

Returns
a representation of the data to be signed.

◆ GetOcsps()

virtual ICollection<IBasicOcspResponse> iText.Signatures.Cms.CMSContainer.GetOcsps ( )
inlinevirtual

Retrieves a copy of the list of OCSPs.

Returns
the list of OCSP revocation info.

◆ GetSerializedSignedAttributes()

virtual byte [] iText.Signatures.Cms.CMSContainer.GetSerializedSignedAttributes ( )
inlinevirtual

Retrieves the encoded signed attributes of the signer info.

Retrieves the encoded signed attributes of the signer info. This makes the signed attributes read only.

Returns
the encoded signed attributes of the signer info.

◆ GetSignerInfo()

virtual SignerInfo iText.Signatures.Cms.CMSContainer.GetSignerInfo ( )
inlinevirtual

This class only supports one signer per signature field.

Returns
the singerInfo

◆ GetSizeEstimation()

virtual long iText.Signatures.Cms.CMSContainer.GetSizeEstimation ( )
inlinevirtual

When all fields except for signer.signedAttributes.digest and signer.signature are completed it is possible to calculate the eventual size of the signature by serializing except for the signature (that depends on the digest and cypher but is set at 1024 bytes) and later added unsigned attributes like timestamps.

Returns
the estimated size of the complete CMS container before signature is added, size for the signature is added, size for other attributes like timestamps is not.

◆ Serialize()

virtual byte [] iText.Signatures.Cms.CMSContainer.Serialize ( )
inlinevirtual

Serializes the SignedData structure and makes the signer infos signed attributes read only.

Returns
the encoded DignedData structure.

◆ SetEncapContentInfo()

virtual void iText.Signatures.Cms.CMSContainer.SetEncapContentInfo ( EncapsulatedContentInfo  encapContentInfo )
inlinevirtual

This represents the signed content.

This represents the signed content. In the case of a signed PDF document this will be of type data with no content. Defaults to 1.2.840.113549.1.7.1 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-7(7) id-data(1)}

Parameters
encapContentInfo a representation of the data to be signed.

◆ SetSerializedSignedAttributes()

virtual void iText.Signatures.Cms.CMSContainer.SetSerializedSignedAttributes ( byte[]  signedAttributesData )
inlinevirtual

Sets the Signed Attributes of the signer info to this serialized version.

Sets the Signed Attributes of the signer info to this serialized version. The signed attributes will become read-only.

Parameters
signedAttributesData the serialized Signed Attributes

◆ SetSignerInfo()

virtual void iText.Signatures.Cms.CMSContainer.SetSignerInfo ( SignerInfo  signerInfo )
inlinevirtual

This class only supports one signer per signature field.

Parameters
signerInfo the singerInfo