Struct dsa::Components
source · pub struct Components { /* private fields */ }
Expand description
The common components of an DSA keypair
(the prime p, quotient q and generator g)
Implementations§
source§impl Components
impl Components
sourcepub fn from_components(p: BigUint, q: BigUint, g: BigUint) -> Result<Self>
pub fn from_components(p: BigUint, q: BigUint, g: BigUint) -> Result<Self>
Construct the common components container from its inner values (p, q and g)
sourcepub fn generate(rng: &mut impl CryptoRngCore, key_size: KeySize) -> Self
pub fn generate(rng: &mut impl CryptoRngCore, key_size: KeySize) -> Self
Generate a new pair of common components
Trait Implementations§
source§impl Clone for Components
impl Clone for Components
source§fn clone(&self) -> Components
fn clone(&self) -> Components
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Components
impl Debug for Components
source§impl<'a> DecodeValue<'a> for Components
impl<'a> DecodeValue<'a> for Components
source§fn decode_value<R: Reader<'a>>(reader: &mut R, _header: Header) -> Result<Self>
fn decode_value<R: Reader<'a>>(reader: &mut R, _header: Header) -> Result<Self>
Attempt to decode this message using the provided [
Reader
].source§impl EncodeValue for Components
impl EncodeValue for Components
source§impl PartialEq for Components
impl PartialEq for Components
source§fn eq(&self, other: &Components) -> bool
fn eq(&self, other: &Components) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Components
impl PartialOrd for Components
source§fn partial_cmp(&self, other: &Components) -> Option<Ordering>
fn partial_cmp(&self, other: &Components) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> Sequence<'a> for Components
impl StructuralPartialEq for Components
Auto Trait Implementations§
impl RefUnwindSafe for Components
impl Send for Components
impl Sync for Components
impl Unpin for Components
impl UnwindSafe for Components
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
Mutably borrows from an owned value. Read more
§impl<'a, T> Choice<'a> for Twhere
T: Decode<'a> + FixedTag,
impl<'a, T> Choice<'a> for Twhere
T: Decode<'a> + FixedTag,
§fn can_decode(tag: Tag) -> bool
fn can_decode(tag: Tag) -> bool
Is the provided [
Tag
] decodable as a variant of this CHOICE
?§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided [Writer
].
§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.
§fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>
Encode this message as ASN.1 DER, appending it to the provided
byte vector.