Struct cryptographic_message_syntax::SignedDataBuilder[][src]

pub struct SignedDataBuilder<'a> { /* fields omitted */ }

Entity for incrementally deriving a SignedData primitive.

Use this type for generating an RFC 5652 payload for signed data.

Implementations

impl<'a> SignedDataBuilder<'a>[src]

pub fn signed_content(self, data: Vec<u8>) -> Self[src]

Define the content to sign.

This content will be embedded in the generated payload.

pub fn signer(self, signer: SignerBuilder<'a>) -> Self[src]

Add a signer.

The signer is the thing generating the cryptographic signature over data to be signed.

pub fn certificate(self, cert: CapturedX509Certificate) -> Self[src]

Add a certificate defined by our crate’s Certificate type.

pub fn certificates(
    self,
    certs: impl Iterator<Item = CapturedX509Certificate>
) -> Self
[src]

Add multiple certificates to the certificates chain.

pub fn content_type(self, oid: Oid) -> Self[src]

Force the OID for the ContentInfo.contentType field.

pub fn build_der(&self) -> Result<Vec<u8>, CmsError>[src]

Construct a DER-encoded ASN.1 document containing a SignedData object.

RFC 5652 says SignedData is BER encoded. However, DER is a stricter subset of BER. DER encodings are valid BER. So producing DER encoded data is perfectly valid. We choose to go with the more well-defined encoding format.

Trait Implementations

impl<'a> Default for SignedDataBuilder<'a>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl<'a> RefUnwindSafe for SignedDataBuilder<'a>

impl<'a> Send for SignedDataBuilder<'a>

impl<'a> Sync for SignedDataBuilder<'a>

impl<'a> Unpin for SignedDataBuilder<'a>

impl<'a> UnwindSafe for SignedDataBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.