Struct openssl::dsa::Dsa
[−]
[src]
pub struct Dsa(_);
Methods
impl Dsa
[src]
fn generate(bits: u32) -> Result<Dsa, ErrorStack>
Generate a DSA key pair.
fn private_key_from_pem(pem: &[u8]) -> Result<Dsa, ErrorStack>
Deserializes a PEM-formatted private key.
fn private_key_from_pem_passphrase(pem: &[u8],
passphrase: &[u8])
-> Result<Dsa, ErrorStack>
passphrase: &[u8])
-> Result<Dsa, ErrorStack>
Deserializes a PEM-formatted private key, using the supplied password if the key is encrypted.
Panics
Panics if passphrase
contains an embedded null.
fn private_key_from_pem_callback<F>(pem: &[u8],
callback: F)
-> Result<Dsa, ErrorStack> where F: FnOnce(&mut [u8]) -> Result<usize, ErrorStack>
callback: F)
-> Result<Dsa, ErrorStack> where F: FnOnce(&mut [u8]) -> Result<usize, ErrorStack>
Deserializes a PEM-formatted private key, using a callback to retrieve a password if the key is encrypted.
The callback should copy the password into the provided buffer and return the number of bytes written.
fn private_key_from_der(der: &[u8]) -> Result<Dsa, ErrorStack>
Deserializes a private key from DER-formatted data.
fn public_key_from_pem(pem: &[u8]) -> Result<Dsa, ErrorStack>
Deserializes a public key from PEM-formatted data.
fn public_key_from_der(der: &[u8]) -> Result<Dsa, ErrorStack>
Deserializes a public key from DER-formatted data.
fn private_key_from_pem_cb<F>(buf: &[u8], pass_cb: F) -> Result<Dsa, ErrorStack> where F: FnOnce(&mut [c_char]) -> usize
: use private_key_from_pem_callback
Methods from Deref<Target=DsaRef>
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 public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes a public key to PEM.
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 size(&self) -> Option<u32>
fn p(&self) -> Option<&BigNumRef>
fn q(&self) -> Option<&BigNumRef>
fn g(&self) -> Option<&BigNumRef>
fn has_public_key(&self) -> bool
fn has_private_key(&self) -> bool
Trait Implementations
impl OpenSslType for Dsa
[src]
type CType = DSA
The raw C type.
type Ref = DsaRef
The type representing a reference to this type.
unsafe fn from_ptr(ptr: *mut DSA) -> Dsa
Constructs an instance of this type from its raw type.
impl Drop for Dsa
[src]
impl Deref for Dsa
[src]
type Target = DsaRef
The resulting type after dereferencing
fn deref(&self) -> &DsaRef
The method called to dereference a value