Struct openssl::dsa::Dsa []

pub struct Dsa(_);

Object representing DSA keys.

A DSA object contains the parameters p, q, and g. There is a private and public key. The values p, g, and q are:

  • p: DSA prime parameter
  • q: DSA sub-prime parameter
  • g: DSA base parameter

These values are used to calculate a pair of asymetrical keys used for signing.

OpenSSL documentation at DSA_new

Examples

use openssl::dsa::Dsa;
use openssl::error::ErrorStack;
fn create_dsa() -> Result< Dsa, ErrorStack > {
    let sign = Dsa::generate(2048)?;
    Ok(sign)
}

Methods

impl Dsa
[src]

[src]

Generate a DSA key pair.

Calls DSA_generate_parameters_ex to populate the p, g, and q values. These values are used to generate the key pair with DSA_generate_key.

The bits parameter coresponds to the length of the prime p.

[src]

Deserializes a PEM-formatted private key.

[src]

Deserializes a PEM-formatted private key, using the supplied password if the key is encrypted.

Panics

Panics if passphrase contains an embedded null.

[src]

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.

[src]

Deserializes a private key from DER-formatted data.

[src]

Deserializes a public key from PEM-formatted data.

[src]

Deserializes a public key from DER-formatted data.

[src]

Deprecated since 0.9.2

: use private_key_from_pem_callback

Methods from Deref<Target = DsaRef>

[src]

Serializes the private key to PEM.

[src]

Serializes the private key to PEM, encrypting it with the specified symmetric cipher and passphrase.

[src]

Serializes a public key to PEM.

[src]

Serializes the private key to DER.

[src]

Serializes the public key to DER.

[src]

Returns the maximum size of the signature output by self in bytes. Returns None if the keys are uninitialized.

OpenSSL documentation at DSA_size

[src]

Returns the DSA prime parameter of self.

[src]

Returns the DSA sub-prime parameter of self.

[src]

Returns the DSA base parameter of self.

[src]

Returns whether the DSA includes a public key, used to confirm the authenticity of the message.

[src]

Returns whether the DSA includes a private key, used to prove the authenticity of a message.

Trait Implementations

impl ForeignType for Dsa

The raw C type.

The type representing a reference to this type.

Constructs an instance of this type from its raw type.

Returns a raw pointer to the wrapped value.

impl Drop for Dsa

Executes the destructor for this type. Read more

impl Deref for Dsa

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for Dsa

Mutably dereferences the value.

impl Borrow<DsaRef> for Dsa

Immutably borrows from an owned value. Read more

impl AsRef<DsaRef> for Dsa

Performs the conversion.

impl Send for Dsa
[src]

impl Sync for Dsa
[src]

impl Debug for Dsa
[src]

[src]

Formats the value using the given formatter.