Struct openssl::dsa::DsaRef

source ·
pub struct DsaRef<T>(/* private fields */);
Expand description

Reference to Dsa.

Implementations§

source§

impl<T> DsaRef<T>where T: HasPublic,

source

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.

source

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.

source

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,

source

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.

source

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.

source

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.

source

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,

source

pub fn size(&self) -> u32

Returns the maximum size of the signature output by self in bytes.

This corresponds to DSA_size.

source

pub fn p(&self) -> &BigNumRef

Returns the DSA prime parameter of self.

This corresponds to DSA_get0_pqg.

source

pub fn q(&self) -> &BigNumRef

Returns the DSA sub-prime parameter of self.

This corresponds to DSA_get0_pqg.

source

pub fn g(&self) -> &BigNumRef

Returns the DSA base parameter of self.

This corresponds to DSA_get0_pqg.

Trait Implementations§

source§

impl<T> AsRef<DsaRef<T>> for Dsa<T>

source§

fn as_ref(&self) -> &DsaRef<T>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Borrow<DsaRef<T>> for Dsa<T>

source§

fn borrow(&self) -> &DsaRef<T>

Immutably borrows from an owned value. Read more
source§

impl<T> ForeignTypeRef for DsaRef<T>

§

type CType = DSA

The raw C type.
source§

unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self

Constructs a shared instance of this type from its raw type.
source§

unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self

Constructs a mutable reference of this type from its raw type.
source§

fn as_ptr(&self) -> *mut Self::CType

Returns a raw pointer to the wrapped value.
source§

impl<T> ToOwned for DsaRef<T>

§

type Owned = Dsa<T>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Dsa<T>

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> Send for DsaRef<T>

source§

impl<T> Sync for DsaRef<T>

Auto Trait Implementations§

§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.