Struct rcgen::Certificate
source · pub struct Certificate { /* private fields */ }
Expand description
A self signed certificate together with signing keys
Implementations§
source§impl Certificate
impl Certificate
sourcepub fn from_params(params: CertificateParams) -> Result<Self, RcgenError>
pub fn from_params(params: CertificateParams) -> Result<Self, RcgenError>
Generates a new certificate from the given parameters
sourcepub fn get_key_identifier(&self) -> Vec<u8>
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.
sourcepub fn serialize_der(&self) -> Result<Vec<u8>, RcgenError>
pub fn serialize_der(&self) -> Result<Vec<u8>, RcgenError>
Serializes the certificate to the binary DER format
sourcepub fn serialize_der_with_signer(
&self,
ca: &Certificate,
) -> Result<Vec<u8>, RcgenError>
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
sourcepub fn serialize_request_der(&self) -> Result<Vec<u8>, RcgenError>
pub fn serialize_request_der(&self) -> Result<Vec<u8>, RcgenError>
Serializes a certificate signing request in binary DER format
sourcepub fn get_key_pair(&self) -> &KeyPair
pub fn get_key_pair(&self) -> &KeyPair
Return the certificate’s key pair
sourcepub fn serialize_pem(&self) -> Result<String, RcgenError>
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
sourcepub fn serialize_pem_with_signer(
&self,
ca: &Certificate,
) -> Result<String, RcgenError>
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
sourcepub fn serialize_request_pem(&self) -> Result<String, RcgenError>
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
sourcepub fn serialize_private_key_der(&self) -> Vec<u8>
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.
sourcepub fn serialize_private_key_pem(&self) -> String
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