Struct openssl::pkey::PKey
[−]
[src]
pub struct PKey(_);
Methods
impl PKey
[src]
fn from_rsa(rsa: Rsa) -> Result<PKey, ErrorStack>
Create a new PKey
containing an RSA key.
fn from_dsa(dsa: Dsa) -> Result<PKey, ErrorStack>
Create a new PKey
containing a DSA key.
fn hmac(key: &[u8]) -> Result<PKey, ErrorStack>
Create a new PKey
containing an HMAC key.
fn private_key_from_pem(buf: &[u8]) -> Result<PKey, ErrorStack>
Reads private key from PEM, takes ownership of handle
fn private_key_from_pem_cb<F>(buf: &[u8], pass_cb: F) -> Result<PKey, ErrorStack> where F: FnOnce(&mut [c_char]) -> usize
Read a private key from PEM, supplying a password callback to be invoked if the private key is encrypted.
The callback will be passed the password buffer and should return the number of characters placed into the buffer.
fn public_key_from_pem(buf: &[u8]) -> Result<PKey, ErrorStack>
Reads public key from PEM, takes ownership of handle
Methods from Deref<Target=PKeyRef>
fn rsa(&self) -> Result<Rsa, ErrorStack>
Get a reference to the interal RSA key for direct access to the key components
fn private_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Stores private key as a PEM
fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Encode public key in PEM format
fn public_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
Encode public key in DER format
fn public_eq(&self, other: &PKeyRef) -> bool
Trait Implementations
impl OpenSslType for PKey
[src]
type CType = EVP_PKEY
The raw C type.
type Ref = PKeyRef
The type representing a reference to this type.
unsafe fn from_ptr(ptr: *mut EVP_PKEY) -> PKey
Constructs an instance of this type from its raw type.
impl Drop for PKey
[src]
impl Deref for PKey
[src]
type Target = PKeyRef
The resulting type after dereferencing
fn deref(&self) -> &PKeyRef
The method called to dereference a value