Struct openssl::crypto::pkey::PKey [] [src]

pub struct PKey(_);

Methods

impl PKey
[src]

Represents a public key, optionally with a private key attached.

fn from_rsa(rsa: RSA) -> Result<PKey, ErrorStack>

Create a new PKey containing an RSA key.

unsafe fn from_ptr(handle: *mut EVP_PKEY) -> PKey

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

fn set_rsa(&mut self, rsa: &RSA) -> Result<(), ErrorStack>

assign RSA key to this pkey

fn get_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>

Stores public key as a PEM

fn as_ptr(&self) -> *mut EVP_PKEY

fn public_eq(&self, other: &PKey) -> bool

Trait Implementations

impl Send for PKey
[src]

impl Sync for PKey
[src]

impl Drop for PKey
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more