pub struct DsaRef<T>(/* private fields */);
Expand description
Reference to Dsa
.
Implementations§
Source§impl<T> DsaRef<T>where
T: HasPublic,
impl<T> DsaRef<T>where
T: HasPublic,
Sourcepub fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
pub fn public_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
The output will have a header of -----BEGIN PUBLIC KEY-----
.
This corresponds to PEM_write_bio_DSA_PUBKEY
.
Sourcepub fn public_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn public_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the public key into a DER-encoded SubjectPublicKeyInfo structure.
This corresponds to i2d_DSA_PUBKEY
.
Sourcepub fn pub_key(&self) -> &BigNumRef
pub fn pub_key(&self) -> &BigNumRef
Returns a reference to the public key component of self
.
This corresponds to DSA_get0_key
.
Source§impl<T> DsaRef<T>where
T: HasPrivate,
impl<T> DsaRef<T>where
T: HasPrivate,
Sourcepub fn private_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
pub fn private_key_to_pem(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the private key to a PEM-encoded DSAPrivateKey structure.
The output will have a header of -----BEGIN DSA PRIVATE KEY-----
.
This corresponds to PEM_write_bio_DSAPrivateKey
.
Sourcepub fn private_key_to_pem_passphrase(
&self,
cipher: Cipher,
passphrase: &[u8],
) -> Result<Vec<u8>, ErrorStack>
pub fn private_key_to_pem_passphrase( &self, cipher: Cipher, passphrase: &[u8], ) -> Result<Vec<u8>, ErrorStack>
Serializes the private key to a PEM-encoded encrypted DSAPrivateKey structure.
The output will have a header of -----BEGIN DSA PRIVATE KEY-----
.
This corresponds to PEM_write_bio_DSAPrivateKey
.
Sourcepub fn private_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn private_key_to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the private_key to a DER-encoded DSAPrivateKey
structure.
This corresponds to i2d_DSAPrivateKey
.
Sourcepub fn priv_key(&self) -> &BigNumRef
pub fn priv_key(&self) -> &BigNumRef
Returns a reference to the private key component of self
.
This corresponds to DSA_get0_key
.
Source§impl<T> DsaRef<T>where
T: HasParams,
impl<T> DsaRef<T>where
T: HasParams,
Sourcepub fn size(&self) -> u32
pub fn size(&self) -> u32
Returns the maximum size of the signature output by self
in bytes.
This corresponds to DSA_size
.
Sourcepub fn p(&self) -> &BigNumRef
pub fn p(&self) -> &BigNumRef
Returns the DSA prime parameter of self
.
This corresponds to DSA_get0_pqg
.
Sourcepub fn q(&self) -> &BigNumRef
pub fn q(&self) -> &BigNumRef
Returns the DSA sub-prime parameter of self
.
This corresponds to DSA_get0_pqg
.
Sourcepub fn g(&self) -> &BigNumRef
pub fn g(&self) -> &BigNumRef
Returns the DSA base parameter of self
.
This corresponds to DSA_get0_pqg
.
Trait Implementations§
Source§impl<T> ForeignTypeRef for DsaRef<T>
impl<T> ForeignTypeRef for DsaRef<T>
Source§impl<T> ToOwned for DsaRef<T>
impl<T> ToOwned for DsaRef<T>
impl<T> Send for DsaRef<T>
impl<T> Sync for DsaRef<T>
Auto Trait Implementations§
impl<T> !Freeze for DsaRef<T>
impl<T> !RefUnwindSafe for DsaRef<T>
impl<T> Unpin for DsaRef<T>where
T: Unpin,
impl<T> UnwindSafe for DsaRef<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes