Enum sequoia_openpgp::crypto::mpi::PublicKey [−][src]
#[non_exhaustive] pub enum PublicKey { RSA { e: MPI, n: MPI, }, DSA { p: MPI, q: MPI, g: MPI, y: MPI, }, ElGamal { p: MPI, g: MPI, y: MPI, }, EdDSA { curve: Curve, q: MPI, }, ECDSA { curve: Curve, q: MPI, }, ECDH { curve: Curve, q: MPI, hash: HashAlgorithm, sym: SymmetricAlgorithm, }, Unknown { mpis: Box<[MPI]>, rest: Box<[u8]>, }, }
Expand description
A public key.
Provides a typed and structured way of storing multiple MPIs (and
the occasional elliptic curve) in Key
packets.
Note: This enum cannot be exhaustively matched to allow future extensions.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
RSA public key.
NIST DSA public key.
Show fields
ElGamal public key.
Show fields
DJBs “Twisted” Edwards curve DSA public key.
NISTs Elliptic curve DSA public key.
Elliptic curve ElGamal public key.
Show fields
Fields of ECDH
curve: Curve
Curve we’re using.
q: MPI
Public point.
hash: HashAlgorithm
Hash algorithm used for key derivation.
sym: SymmetricAlgorithm
Algorithm used w/the derived key.
Unknown number of MPIs for an unknown algorithm.
Show fields
Implementations
Returns the length of the public key in bits.
For finite field crypto this returns the size of the field we
operate in, for ECC it returns Curve::bits()
.
Note: This information is useless and should not be used to gauge the security of a particular key. This function exists only because some legacy PGP application like HKP need it.
Returns None
for unknown keys and curves.
Returns, if known, the public-key algorithm for this public key.
Parses a set of OpenPGP MPIs representing a public key.
See Section 3.2 of RFC 4880 for details.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self