Struct cryptographic_message_syntax::Certificate[][src]

pub struct Certificate {
    pub public_key: CertificatePublicKey,
    // some fields omitted
}

Defines an X.509 certificate used for signing data.

Fields

public_key: CertificatePublicKey

The public key for this certificate.

Implementations

impl Certificate[src]

pub fn from_parsed_asn1(cert: Certificate) -> Result<Self, CmsError>[src]

Obtain an instance from an already parsed ASN.1 data structure.

pub fn from_der(data: &[u8]) -> Result<Self, CmsError>[src]

pub fn from_pem(data: &[u8]) -> Result<Self, CmsError>[src]

pub fn serial_number(&self) -> &Integer[src]

The serial number of this certificate.

(Used for identification purposes.)

pub fn subject(&self) -> &Name[src]

The subject of this certificate.

(Used for identification purposes.)

pub fn subject_dn(&self) -> Result<RelativeDistinguishedName, CmsError>[src]

Obtain the subject as a parsed object.

pub fn issuer(&self) -> &Name[src]

The issuer of this certificate.

(Used for identification purposes.)

pub fn issuer_dn(&self) -> Result<RelativeDistinguishedName, CmsError>[src]

Obtain the issuer as a parsed object.

pub fn public_key(&self) -> &CertificatePublicKey[src]

Obtain the public key associated with this certificate.

The public keys gives you access to the pieces needed to perform cryptographic signature verification.

pub fn raw_certificate(&self) -> &Certificate[src]

Obtain the parsed certificate data structure backing this instance.

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

Serialize this certificate to BER.

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

Serialize this certificate to DER.

pub fn as_pem(&self) -> Result<String, CmsError>[src]

Serialize this certificate to PEM.

Trait Implementations

impl Clone for Certificate[src]

impl Debug for Certificate[src]

impl Eq for Certificate[src]

impl From<Certificate> for IssuerAndSerialNumber[src]

impl PartialEq<Certificate> for Certificate[src]

impl StructuralEq for Certificate[src]

impl StructuralPartialEq for Certificate[src]

impl TryFrom<&'_ Certificate> for Certificate[src]

type Error = CmsError

The type returned in the event of a conversion error.

impl TryFrom<&'_ CertificateChoices> for Certificate[src]

type Error = CmsError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.