Struct openssl::pkey::PKeyRef
[−]
[src]
pub struct PKeyRef(_);
Methods
impl PKeyRef
[src]
fn rsa(&self) -> Result<Rsa, ErrorStack>
Returns a copy of the internal RSA key.
fn dsa(&self) -> Result<Dsa, ErrorStack>
Returns a copy of the internal DSA key.
fn dh(&self) -> Result<Dh, ErrorStack>
Returns a copy of the internal DH key.
fn ec_key(&self) -> Result<EcKey, ErrorStack>
Returns a copy of the internal elliptic curve key.
fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes a public key to PEM.
fn private_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the private key to PEM.
fn private_key_to_pem_passphrase(&self,
cipher: Cipher,
passphrase: &[u8])
-> Result<Vec<u8>, ErrorStack>
cipher: Cipher,
passphrase: &[u8])
-> Result<Vec<u8>, ErrorStack>
Serializes the private key to PEM, encrypting it with the specified symmetric cipher and passphrase.
fn private_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the private key to DER.
fn public_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the public key to DER.
fn bits(&self) -> u32
Returns the size of the key.
This corresponds to the bit length of the modulus of an RSA key, and the bit length of the group order for an elliptic curve key, for example.
fn public_eq(&self, other: &PKeyRef) -> bool
Compares the public component of this key with another.
Trait Implementations
impl OpenSslTypeRef for PKeyRef
[src]
type CType = EVP_PKEY
The raw C type.
unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
Constructs a shared instance of this type from its raw type.
unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self
Constructs a mutable reference of this type from its raw type.
fn as_ptr(&self) -> *mut Self::CType
Returns a raw pointer to the wrapped value.