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

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

This function is only available if rcgen is built with the “pem” feature

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

This function is only available if rcgen is built with the “pem” feature

source

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

Serializes the certificate signing request to the ASCII PEM format

This function is only available if rcgen is built with the “pem” feature

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.

This function is only available if rcgen is built with the “pem” feature

Auto Trait Implementations§

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

§

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

§

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.