#[non_exhaustive]
pub enum Signature {
RSA {
s: MPI,
},
DSA {
r: MPI,
s: MPI,
},
ElGamal {
r: MPI,
s: MPI,
},
EdDSA {
r: MPI,
s: MPI,
},
ECDSA {
r: MPI,
s: MPI,
},
Unknown {
mpis: Box<[MPI]>,
rest: Box<[u8]>,
},
}
Expand description
A cryptographic signature.
Provides a typed and structured way of storing multiple MPIs in
Signature
packets.
Note: This enum cannot be exhaustively matched to allow future extensions.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
RSA
Fields
s: MPI
Signature m^d mod N.
RSA signature.
DSA
NIST’s DSA signature.
ElGamal
ElGamal signature.
EdDSA
DJB’s “Twisted” Edwards curve DSA signature.
ECDSA
NIST’s Elliptic curve DSA signature.
Unknown
Unknown number of MPIs for an unknown algorithm.
Implementations
sourceimpl Signature
impl Signature
sourcepub fn parse<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
pub fn parse<R: Read + Send + Sync>(
algo: PublicKeyAlgorithm,
reader: R
) -> Result<Self>
Parses a set of OpenPGP MPIs representing a signature.
Expects MPIs for a public key algorithm algo
s signature.
See Section 3.2 of RFC 4880 for details.
Trait Implementations
sourceimpl MarshalInto for Signature
impl MarshalInto for Signature
sourcefn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation. Read more
sourcefn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
sourceimpl Ord for Signature
impl Ord for Signature
sourceimpl PartialOrd<Signature> for Signature
impl PartialOrd<Signature> for Signature
sourcefn partial_cmp(&self, other: &Signature) -> Option<Ordering>
fn partial_cmp(&self, other: &Signature) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more