Org.BouncyCastle.Cms.CmsSignedDataStreamGenerator
Streaming generator for CMS SignedData (PKCS#7 signed-data) messages. Configure signers with
AddSigner (and overloads), add
certificates and CRLs via the base CmsSignedGenerator methods, then call
Open to obtain a Stream to which the content being signed is written.
Closing that stream finalizes the CMS structure.
public CmsSignedDataStreamGenerator()
Creates a generator using the default randomness source.
Creates a generator with an explicit randomness source for signature generation.
Registers one or more digest algorithm OIDs to be computed over the signed content.
Registers one or more digest algorithm OIDs to be computed over the signed content.
Adds a signer identified by certificate, inferring the signature algorithm OID from the key type.
Only default signed attributes are included.
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid)
Adds a signer identified by certificate with explicit digest and signature algorithm OIDs.
Only default signed attributes are included.
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, AttributeTable signedAttr, AttributeTable unsignedAttr)
Adds a certificate-identified signer with caller-supplied signed and unsigned attribute tables.
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, AttributeTable signedAttr, AttributeTable unsignedAttr)
Adds a certificate-identified signer with explicit algorithm OIDs and attribute tables.
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
Adds a certificate-identified signer with caller-supplied attribute table generators, inferring the
signature algorithm OID from the key type.
public void AddSigner(AsymmetricKeyParameter privateKey, X509Certificate cert, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
Adds a certificate-identified signer with explicit algorithm OIDs and attribute table generators.
Adds a signer identified by subject key identifier, inferring the signature algorithm OID from the key.
Only default signed attributes are included.
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid)
Adds a signer identified by subject key identifier with explicit digest and signature algorithm OIDs.
Only default signed attributes are included.
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, AttributeTable signedAttr, AttributeTable unsignedAttr)
Adds a subject-key-id-identified signer with caller-supplied signed and unsigned attribute tables.
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
Adds a subject-key-id-identified signer with caller-supplied attribute table generators, inferring the
signature algorithm OID from the key type.
public void AddSigner(AsymmetricKeyParameter privateKey, byte[] subjectKeyID, string encryptionOid, string digestOid, CmsAttributeTableGenerator signedAttrGenerator, CmsAttributeTableGenerator unsignedAttrGenerator)
Adds a subject-key-id-identified signer with explicit algorithm OIDs and attribute table generators.
Opens a stream for generating a CMS SignedData object. The content is signed but not encapsulated.
Opens a stream for generating a CMS SignedData object using the default content type "data".
Opens a stream for generating a CMS SignedData object using the default content type "data", optionally
copying the content being signed to a second stream as it is processed.
Opens a stream for generating a CMS SignedData object with the given encapsulated content type.
public Stream Open(Stream outStream, string signedContentType, bool encapsulate, Stream dataOutputStream)
Opens a stream for generating a CMS SignedData object with the given encapsulated content type, optionally
copying the content being signed to a second stream as it is processed.
Opens a stream for generating a CMS SignedData object with the given encapsulated content type.
public Stream Open(Stream outStream, DerObjectIdentifier contentType, bool encapsulate, Stream dataOutputStream)
Opens a stream for generating a CMS SignedData object with the given encapsulated content type, optionally
copying the content being signed to a second stream as it is processed.
Sets the buffer size used for the OCTET STRING segments holding the encapsulated content.