Skip to main content

Cms

Struct Cms 

Source
pub struct Cms;

Implementations§

Source§

impl Cms

Source

pub fn encode_supporting_certificates( certificates: &[Certificate], ) -> Result<Vec<u8>>

Examples found in repository?
examples/11_cms_cert_bag.rs (line 8)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    let certificate = Certificate::from_der(&support::fixture("test-cert.der"))?;
8    let encoded = Cms::encode_supporting_certificates(&[certificate])?;
9    let decoded = Cms::decode_all_certificates(&encoded)?;
10    println!("cms_len={} certs={}", encoded.len(), decoded.len());
11    Ok(())
12}
Source

pub fn decode_all_certificates(data: &[u8]) -> Result<Vec<Certificate>>

Examples found in repository?
examples/11_cms_cert_bag.rs (line 9)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7    let certificate = Certificate::from_der(&support::fixture("test-cert.der"))?;
8    let encoded = Cms::encode_supporting_certificates(&[certificate])?;
9    let decoded = Cms::decode_all_certificates(&encoded)?;
10    println!("cms_len={} certs={}", encoded.len(), decoded.len());
11    Ok(())
12}

Auto Trait Implementations§

§

impl Freeze for Cms

§

impl RefUnwindSafe for Cms

§

impl Send for Cms

§

impl Sync for Cms

§

impl Unpin for Cms

§

impl UnsafeUnpin for Cms

§

impl UnwindSafe for Cms

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, 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.