Struct SignedDataBuilder

Source
pub struct SignedDataBuilder<'s> { /* private fields */ }
Available on crate feature builder only.
Expand description

Builder for signedData (CMS and PKCS #7)

Implementations§

Source§

impl<'s> SignedDataBuilder<'s>

Source

pub fn new( encapsulated_content_info: &'s EncapsulatedContentInfo, ) -> SignedDataBuilder<'s>

Create a new builder for SignedData

Source

pub fn add_digest_algorithm( &mut self, digest_algorithm: AlgorithmIdentifierOwned, ) -> Result<&mut Self, Error>

Add a digest algorithm to the collection of message digest algorithms. RFC 5652 § 5.1: digestAlgorithms is a collection of message digest algorithm identifiers. There MAY be any number of elements in the collection, including zero. Each element identifies the message digest algorithm, along with any associated parameters, used by one or more signer. The collection is intended to list the message digest algorithms employed by all of the signers, in any order, to facilitate one-pass signature verification.

Source

pub fn add_certificate( &mut self, certificate: CertificateChoices, ) -> Result<&mut Self, Error>

Add a certificate to the certificate collection. RFC 5652 § 5.1: certificates is a collection of certificates. It is intended that the set of certificates be sufficient to contain certification paths from a recognized “root” or “top-level certification authority” to all of the signers in the signerInfos field. There may be more certificates than necessary, and there may be certificates sufficient to contain certification paths from two or more independent top-level certification authorities. There may also be fewer certificates than necessary, if it is expected that recipients have an alternate means of obtaining necessary certificates (e.g., from a previous set of certificates). The signer’s certificate MAY be included. The use of version 1 attribute certificates is strongly discouraged.

Source

pub fn add_crl(&mut self, crl: RevocationInfoChoice) -> Result<&mut Self, Error>

Add a CRL to the collection of CRLs. RFC 5652 § 5.1: crls is a collection of revocation status information. It is intended that the collection contain information sufficient to determine whether the certificates in the certificates field are valid, but such correspondence is not necessary. Certificate revocation lists (CRLs) are the primary source of revocation status information. There MAY be more CRLs than necessary, and there MAY also be fewer CRLs than necessary.

Source

pub fn add_signer_info<S, Signature>( &mut self, signer_info_builder: SignerInfoBuilder<'_, S>, ) -> Result<&mut Self, Error>

Add a signer info. The signature will be calculated. Note that the encapsulated content must not be changed after the first signer info was added.

Source

pub fn build(&mut self) -> Result<ContentInfo, Error>

This method returns a ContentInfo of type signedData.

Auto Trait Implementations§

§

impl<'s> Freeze for SignedDataBuilder<'s>

§

impl<'s> RefUnwindSafe for SignedDataBuilder<'s>

§

impl<'s> Send for SignedDataBuilder<'s>

§

impl<'s> Sync for SignedDataBuilder<'s>

§

impl<'s> Unpin for SignedDataBuilder<'s>

§

impl<'s> UnwindSafe for SignedDataBuilder<'s>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V