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