Struct Issuer

Source
pub struct Issuer<'a, S> { /* private fields */ }
Expand description

An issuer that can sign certificates.

Encapsulates the distinguished name, key identifier method, key usages and signing key of the issuing certificate.

Implementations§

Source§

impl<'a, S: SigningKey> Issuer<'a, S>

Source

pub fn new(params: CertificateParams, signing_key: S) -> Self

Create a new issuer from the given parameters and signing key.

Source

pub fn from_ca_cert_pem(pem_str: &str, signing_key: S) -> Result<Self, Error>

Available on crate features pem and x509-parser only.

Parses an existing CA certificate from the ASCII PEM format.

See from_ca_cert_der for more details.

Source

pub fn from_ca_cert_der( ca_cert: &CertificateDer<'_>, signing_key: S, ) -> Result<Self, Error>

Available on crate feature x509-parser only.

Parses an existing CA certificate from the DER format.

This function assumes the provided certificate is a CA. It will not check for the presence of the BasicConstraints extension, or perform any other validation.

If you already have a byte slice containing DER, it can trivially be converted into CertificateDer using the Into trait.

Source

pub fn key_usages(&self) -> &[KeyUsagePurpose]

Allowed key usages for this issuer.

Source

pub fn key(&self) -> &S

Yield a reference to the signing key.

Trait Implementations§

Source§

impl<'a, S: SigningKey> Debug for Issuer<'a, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the issuer information without revealing the key pair.

Auto Trait Implementations§

§

impl<'a, S> Freeze for Issuer<'a, S>
where S: Freeze,

§

impl<'a, S> RefUnwindSafe for Issuer<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for Issuer<'a, S>
where S: Send + Sync,

§

impl<'a, S> Sync for Issuer<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for Issuer<'a, S>
where S: Unpin,

§

impl<'a, S> UnwindSafe for Issuer<'a, 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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.