Struct rcgen::Certificate

source ·
pub struct Certificate { /* private fields */ }
Expand description

A self signed certificate together with signing keys

Implementations§

source§

impl Certificate

source

pub fn from_params(params: CertificateParams) -> Result<Self, RcgenError>

Generates a new certificate from the given parameters.

If there is no key pair included, then a new key pair will be generated and used.

source

pub fn get_params(&self) -> &CertificateParams

Returns the certificate parameters

source

pub fn get_key_identifier(&self) -> Vec<u8>

Calculates a subject key identifier for the certificate subject’s public key. This key identifier is used in the SubjectKeyIdentifier X.509v3 extension.

source

pub fn serialize_der(&self) -> Result<Vec<u8>, RcgenError>

Serializes the certificate to the binary DER format

source

pub fn serialize_der_with_signer( &self, ca: &Certificate ) -> Result<Vec<u8>, RcgenError>

Serializes the certificate, signed with another certificate’s key, in binary DER format

source

pub fn serialize_request_der(&self) -> Result<Vec<u8>, RcgenError>

Serializes a certificate signing request in binary DER format

source

pub fn get_key_pair(&self) -> &KeyPair

Return the certificate’s key pair

source

pub fn serialize_pem(&self) -> Result<String, RcgenError>

Serializes the certificate to the ASCII PEM format

source

pub fn serialize_pem_with_signer( &self, ca: &Certificate ) -> Result<String, RcgenError>

Serializes the certificate, signed with another certificate’s key, to the ASCII PEM format

source

pub fn serialize_request_pem(&self) -> Result<String, RcgenError>

Serializes the certificate signing request to the ASCII PEM format

source

pub fn serialize_private_key_der(&self) -> Vec<u8>

Serializes the private key in PKCS#8 format

Panics if called on a remote key pair.

source

pub fn serialize_private_key_pem(&self) -> String

Serializes the private key in PEM format

Panics if called on a remote key pair.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

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

§

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

§

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

source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.