#[non_exhaustive]pub enum PublicKeyAlgorithm {
Show 14 variants
RSA,
Cv25519,
X25519,
X448,
EdDSA,
Ed25519,
Ed448,
MLDSA65_Ed25519,
MLDSA87_Ed448,
SLHDSA128s,
SLHDSA128f,
SLHDSA256s,
MLKEM768_X25519,
MLKEM1024_X448,
}Expand description
Public-key algorithms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RSA
Cv25519
Cv25519.
Cv25519 is defined by RFC 6637.
Note: Cv25519 has been deprecated by RFC 9580 and must only
be used with v4 certificates. For v6 certificates, prefer
PublicKeyAlgorithm::X25519 instead.
X25519
X25519.
X25519 is defined by RFC 9580.
X25519 keys can be used with v4-based certificates, but for wide compatibility it is recommended to use Cv25519.
X448
X448.
X448 is defined by RFC 9580.
EdDSA
EdDSA.
EdDSA is defined by RFC 6637.
Note: [EdDSA has been deprecated] by RFC 9580 and must only
be used with v4 certificates. For v6 certificates, prefer
PublicKeyAlgorithm::Ed25519 instead.
Ed25519
Ed25519.
Ed25519 is defined by RFC 9580.
Ed25519 keys can be used with v4-based certificates, but for wide compatibility it is recommended to use EdDSA keys.
Ed448
Ed448.
Ed448 is defined by RFC 9580.
MLDSA65_Ed25519
ML-DSA-65+Ed25519.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
MLDSA87_Ed448
ML-DSA-87+Ed448.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
SLHDSA128s
SLH-DSA-128s.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
SLHDSA128f
SLH-DSA-128f.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
SLHDSA256s
SLH-DSA-256s.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
MLKEM768_X25519
MLKEM768+X25519.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
MLKEM1024_X448
MLKEM1024+X448.
As defined by the Post-Quantum Cryptography in OpenPGP draft specification.
Implementations§
Source§impl PublicKeyAlgorithm
impl PublicKeyAlgorithm
Sourcepub fn for_signing(&self) -> bool
pub fn for_signing(&self) -> bool
Returns whether the algorithm can be used for signing.
Sourcepub fn for_encryption(&self) -> bool
pub fn for_encryption(&self) -> bool
Returns whether the algorithm can be used for encryption.
Trait Implementations§
Source§impl Clone for PublicKeyAlgorithm
impl Clone for PublicKeyAlgorithm
Source§fn clone(&self) -> PublicKeyAlgorithm
fn clone(&self) -> PublicKeyAlgorithm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PublicKeyAlgorithm
impl Debug for PublicKeyAlgorithm
Source§impl Display for PublicKeyAlgorithm
impl Display for PublicKeyAlgorithm
impl Eq for PublicKeyAlgorithm
Source§impl From<PublicKeyAlgorithm> for PublicKeyAlgorithm
impl From<PublicKeyAlgorithm> for PublicKeyAlgorithm
Source§fn from(pk: PublicKeyAlgorithm) -> PublicKeyAlgorithm
fn from(pk: PublicKeyAlgorithm) -> PublicKeyAlgorithm
Note: this is a lossy transformation.
EdDSA and Cv25519 map onto to EdDSA and ECDH,
respectively, which are actually group of algorithms.
Source§impl FromStr for PublicKeyAlgorithm
impl FromStr for PublicKeyAlgorithm
Source§impl PartialEq for PublicKeyAlgorithm
impl PartialEq for PublicKeyAlgorithm
impl StructuralPartialEq for PublicKeyAlgorithm
Auto Trait Implementations§
impl Freeze for PublicKeyAlgorithm
impl RefUnwindSafe for PublicKeyAlgorithm
impl Send for PublicKeyAlgorithm
impl Sync for PublicKeyAlgorithm
impl Unpin for PublicKeyAlgorithm
impl UnsafeUnpin for PublicKeyAlgorithm
impl UnwindSafe for PublicKeyAlgorithm
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.