pub struct SignerBuilder<'a> { /* private fields */ }Expand description
Builder type to construct an entity that will sign some data.
Instances will be attached to SignedDataBuilder instances where they
will sign data using configured settings.
Implementations§
Source§impl<'a> SignerBuilder<'a>
impl<'a> SignerBuilder<'a>
Sourcepub fn new(
signing_key: &'a dyn KeyInfoSigner,
signing_certificate: CapturedX509Certificate,
) -> Self
pub fn new( signing_key: &'a dyn KeyInfoSigner, signing_certificate: CapturedX509Certificate, ) -> Self
Construct a new entity that will sign content.
An entity is constructed from a signing key, which is mandatory.
Sourcepub fn new_with_signer_identifier(
signing_key: &'a dyn KeyInfoSigner,
signer_identifier: SignerIdentifier,
) -> Self
pub fn new_with_signer_identifier( signing_key: &'a dyn KeyInfoSigner, signer_identifier: SignerIdentifier, ) -> Self
Construct a new entity that will sign content.
An entity is constructed from a signing key and signer identifier, which are mandatory.
Sourcepub fn signature_algorithm(&self) -> Result<SignatureAlgorithm, CmsError>
pub fn signature_algorithm(&self) -> Result<SignatureAlgorithm, CmsError>
Obtain the signature algorithm used by the signing key.
Sourcepub fn message_id_content(self, data: Vec<u8>) -> Self
pub fn message_id_content(self, data: Vec<u8>) -> Self
Define the content to use to calculate the message-id attribute.
In most cases, this is never called and the encapsulated content
embedded within the generated message is used. However, some users
omit storing the data inline and instead use a message-id digest
calculated from a different source. This defines that different source.
Sourcepub fn content_type(self, oid: Oid) -> Self
pub fn content_type(self, oid: Oid) -> Self
Define the content type of the signed content.
Sourcepub fn signed_attribute(self, typ: Oid, values: Vec<AttributeValue>) -> Self
pub fn signed_attribute(self, typ: Oid, values: Vec<AttributeValue>) -> Self
Add an additional attribute to sign.
Sourcepub fn signed_attribute_octet_string(self, typ: Oid, data: &[u8]) -> Self
pub fn signed_attribute_octet_string(self, typ: Oid, data: &[u8]) -> Self
Add an additional OctetString signed attribute.
This is a helper for converting a byte slice to an OctetString and AttributeValue without having to go through low-level ASN.1 code.
Trait Implementations§
Source§impl<'a> Clone for SignerBuilder<'a>
impl<'a> Clone for SignerBuilder<'a>
Source§fn clone(&self) -> SignerBuilder<'a>
fn clone(&self) -> SignerBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more