pub struct DsaPublicKey { /* private fields */ }Expand description
Public key for DSA.
Implementations§
Source§impl DsaPublicKey
impl DsaPublicKey
Sourcepub fn subgroup_order(&self) -> &BigUint
pub fn subgroup_order(&self) -> &BigUint
Return the prime subgroup order.
Sourcepub fn public_component(&self) -> &BigUint
pub fn public_component(&self) -> &BigUint
Return the public component y = g^x mod p.
Sourcepub fn verify_message<H: Digest>(
&self,
message: &[u8],
signature: &DsaSignature,
) -> bool
pub fn verify_message<H: Digest>( &self, message: &[u8], signature: &DsaSignature, ) -> bool
Hash one message with H, then verify the resulting digest.
Sourcepub fn verify_message_bytes<H: Digest>(
&self,
message: &[u8],
signature: &[u8],
) -> bool
pub fn verify_message_bytes<H: Digest>( &self, message: &[u8], signature: &[u8], ) -> bool
Hash one message with H, then verify a serialized signature.
Sourcepub fn verify_digest_scalar(
&self,
hash: &BigUint,
signature: &DsaSignature,
) -> bool
pub fn verify_digest_scalar( &self, hash: &BigUint, signature: &DsaSignature, ) -> bool
Verify a signature over an explicit integer representative.
Sourcepub fn verify(&self, digest: &[u8], signature: &DsaSignature) -> bool
pub fn verify(&self, digest: &[u8], signature: &DsaSignature) -> bool
Verify a signature over the provided digest bytes.
The digest is reduced to the leftmost N = bits(q) bits, matching the
DSA representative construction from the Digital Signature Standard.
Sourcepub fn verify_bytes(&self, digest: &[u8], signature: &[u8]) -> bool
pub fn verify_bytes(&self, digest: &[u8], signature: &[u8]) -> bool
Verify a byte-encoded signature produced by [DsaPrivateKey::sign_bytes].
Sourcepub fn to_key_blob(&self) -> Vec<u8> ⓘ
pub fn to_key_blob(&self) -> Vec<u8> ⓘ
Encode the public key in the crate-defined binary format.
Sourcepub fn from_key_blob(blob: &[u8]) -> Option<Self>
pub fn from_key_blob(blob: &[u8]) -> Option<Self>
Decode the public key from the crate-defined binary format.
Trait Implementations§
Source§impl Clone for DsaPublicKey
impl Clone for DsaPublicKey
Source§fn clone(&self) -> DsaPublicKey
fn clone(&self) -> DsaPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DsaPublicKey
impl Debug for DsaPublicKey
Source§impl PartialEq for DsaPublicKey
impl PartialEq for DsaPublicKey
Source§fn eq(&self, other: &DsaPublicKey) -> bool
fn eq(&self, other: &DsaPublicKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for DsaPublicKey
impl StructuralPartialEq for DsaPublicKey
Auto Trait Implementations§
impl Freeze 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 DsaPublicKey
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