pub struct DsaPublicKey { /* private fields */ }Available on crate feature
alloc only.Expand description
Digital Signature Algorithm (DSA) public key.
Described in FIPS 186-4 § 4.1.
Implementations§
Source§impl DsaPublicKey
impl DsaPublicKey
Sourcepub fn new(p: Mpint, q: Mpint, g: Mpint, y: Mpint) -> Result<Self>
pub fn new(p: Mpint, q: Mpint, g: Mpint, y: Mpint) -> Result<Self>
Create a new DsaPublicKey with the following components:
p: prime modulus.q: prime divisor ofp - 1.g: generator of a subgroup of orderqin the multiplicative groupGF(p), such that1 < g < p.y: the public key, wherey = gˣ mod p.
§Errors
Returns Error::FormatEncoding if any component is zero.
Trait Implementations§
Source§impl Clone for DsaPublicKey
impl Clone for DsaPublicKey
Source§impl Debug for DsaPublicKey
impl Debug for DsaPublicKey
Source§impl Decode for DsaPublicKey
impl Decode for DsaPublicKey
Source§impl Encode for DsaPublicKey
impl Encode for DsaPublicKey
Source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Get the length of this type encoded in bytes, prior to Base64 encoding. Read more
Source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a
uint32 length prefix. Read moreimpl Eq for DsaPublicKey
Source§impl From<&DsaKeypair> for DsaPublicKey
impl From<&DsaKeypair> for DsaPublicKey
Source§fn from(keypair: &DsaKeypair) -> DsaPublicKey
fn from(keypair: &DsaKeypair) -> DsaPublicKey
Converts to this type from the input type.
Source§impl From<DsaKeypair> for DsaPublicKey
impl From<DsaKeypair> for DsaPublicKey
Source§fn from(keypair: DsaKeypair) -> DsaPublicKey
fn from(keypair: DsaKeypair) -> DsaPublicKey
Converts to this type from the input type.
Source§impl From<DsaPublicKey> for KeyData
impl From<DsaPublicKey> for KeyData
Source§fn from(public_key: DsaPublicKey) -> KeyData
fn from(public_key: DsaPublicKey) -> KeyData
Converts to this type from the input type.
Source§impl From<DsaPublicKey> for PublicKey
impl From<DsaPublicKey> for PublicKey
Source§fn from(public_key: DsaPublicKey) -> PublicKey
fn from(public_key: DsaPublicKey) -> PublicKey
Converts to this type from the input type.
Source§impl Hash for DsaPublicKey
impl Hash for DsaPublicKey
Source§impl Ord for DsaPublicKey
impl Ord for DsaPublicKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for DsaPublicKey
impl PartialEq for DsaPublicKey
Source§impl PartialOrd for DsaPublicKey
impl PartialOrd for DsaPublicKey
impl StructuralPartialEq for DsaPublicKey
Source§impl TryFrom<&DsaPublicKey> for VerifyingKey
Available on crate feature dsa only.
impl TryFrom<&DsaPublicKey> for VerifyingKey
Available on crate feature
dsa only.Source§fn try_from(key: &DsaPublicKey) -> Result<VerifyingKey>
fn try_from(key: &DsaPublicKey) -> Result<VerifyingKey>
Performs the conversion.
Source§impl TryFrom<&VerifyingKey> for DsaPublicKey
Available on crate feature dsa only.
impl TryFrom<&VerifyingKey> for DsaPublicKey
Available on crate feature
dsa only.Source§fn try_from(key: &VerifyingKey) -> Result<DsaPublicKey>
fn try_from(key: &VerifyingKey) -> Result<DsaPublicKey>
Performs the conversion.
Source§impl TryFrom<DsaPublicKey> for VerifyingKey
Available on crate feature dsa only.
impl TryFrom<DsaPublicKey> for VerifyingKey
Available on crate feature
dsa only.Source§fn try_from(key: DsaPublicKey) -> Result<VerifyingKey>
fn try_from(key: DsaPublicKey) -> Result<VerifyingKey>
Performs the conversion.
Source§impl TryFrom<VerifyingKey> for DsaPublicKey
Available on crate feature dsa only.
impl TryFrom<VerifyingKey> for DsaPublicKey
Available on crate feature
dsa only.Source§fn try_from(key: VerifyingKey) -> Result<DsaPublicKey>
fn try_from(key: VerifyingKey) -> Result<DsaPublicKey>
Performs the conversion.
Source§impl Verifier<Signature> for DsaPublicKey
Available on crate feature dsa and (crate features alloc or mldsa) only.
impl Verifier<Signature> for DsaPublicKey
Available on crate feature
dsa and (crate features alloc or mldsa) only.Auto Trait Implementations§
impl Forget for DsaPublicKey
impl Freeze for DsaPublicKey
impl Move for DsaPublicKey
impl RefUnwindSafe for DsaPublicKey
impl Send for DsaPublicKey
impl Sync for DsaPublicKey
impl Unpin for DsaPublicKey
impl UnsafeUnpin for DsaPublicKey
impl UnwindSafe for DsaPublicKeywhere
BoxRaw<[u8]>: UnwindSafe,
Blanket Implementations§
Source§impl<S, T> AsyncVerifier<S> for Twhere
T: Verifier<S>,
impl<S, T> AsyncVerifier<S> for Twhere
T: Verifier<S>,
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