Struct rcgen::KeyPair [−][src]
A key pair used to sign certificates and CSRs
Implementations
impl KeyPair
[src]
pub fn from_pem(pem_str: &str) -> Result<Self, RcgenError>
[src]
Parses the key pair from the ASCII PEM format
impl KeyPair
[src]
pub fn generate(alg: &'static SignatureAlgorithm) -> Result<Self, RcgenError>
[src]
Generate a new random key pair for the specified signature algorithm
pub fn public_key_raw(&self) -> &[u8]
[src]
Get the raw public key of this key pair
The key is in raw format, as how ring::signature::KeyPair::public_key
would output, and how ring::signature::verify
would accept.
pub fn is_compatible(&self, signature_algorithm: &SignatureAlgorithm) -> bool
[src]
Check if this key pair can be used with the given signature algorithm
pub fn compatible_algs(
&self
) -> impl Iterator<Item = &'static SignatureAlgorithm>
[src]
&self
) -> impl Iterator<Item = &'static SignatureAlgorithm>
Returns (possibly multiple) compatible SignatureAlgorithm
’s
that the key can be used with
pub fn public_key_der(&self) -> Vec<u8>
[src]
Return the key pair’s public key in DER format
The key is formatted according to the SubjectPublicKeyInfo struct of X.509 see https://tools.ietf.org/html/rfc5280#section-4.1
pub fn public_key_pem(&self) -> String
[src]
Return the key pair’s public key in PEM format
The returned string can be interpreted with openssl pkey --inform PEM -pubout -pubin -text
pub fn serialize_der(&self) -> Vec<u8>
[src]
Serializes the key pair (including the private key) in PKCS#8 format in DER
pub fn serialize_pem(&self) -> String
[src]
Serializes the key pair (including the private key) in PKCS#8 format in PEM
Trait Implementations
impl Debug for KeyPair
[src]
impl TryFrom<&'_ [u8]> for KeyPair
[src]
type Error = RcgenError
The type returned in the event of a conversion error.
fn try_from(pkcs8: &[u8]) -> Result<KeyPair, RcgenError>
[src]
Auto Trait Implementations
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,