Struct openssl::dsa::Dsa
[−]
pub struct Dsa(_);
Methods
impl Dsa
[src]
fn generate(bits: u32) -> Result<Dsa, ErrorStack>
[src]
Generate a DSA key pair.
fn private_key_from_pem(pem: &[u8]) -> Result<Dsa, ErrorStack>
[src]
Deserializes a PEM-formatted private key.
fn private_key_from_pem_passphrase(
pem: &[u8],
passphrase: &[u8]
) -> Result<Dsa, ErrorStack>
[src]
pem: &[u8],
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>,
[src]
pem: &[u8],
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>
[src]
Deserializes a private key from DER-formatted data.
fn public_key_from_pem(pem: &[u8]) -> Result<Dsa, ErrorStack>
[src]
Deserializes a public key from PEM-formatted data.
fn public_key_from_der(der: &[u8]) -> Result<Dsa, ErrorStack>
[src]
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,
[src]
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>
[src]
Serializes the private key to PEM.
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.
fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
[src]
Serializes a public key to PEM.
fn private_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
[src]
Serializes the private key to DER.
fn public_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
[src]
Serializes the public key to DER.
fn size(&self) -> Option<u32>
[src]
fn p(&self) -> Option<&BigNumRef>
[src]
fn q(&self) -> Option<&BigNumRef>
[src]
fn g(&self) -> Option<&BigNumRef>
[src]
fn has_public_key(&self) -> bool
[src]
fn has_private_key(&self) -> bool
[src]
Trait Implementations
impl ForeignType for Dsa
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.
fn as_ptr(&self) -> *mut DSA
Returns a raw pointer to the wrapped value.
impl Drop for Dsa
impl Deref for Dsa
type Target = DsaRef
The resulting type after dereferencing.
fn deref(&self) -> &DsaRef
Dereferences the value.