#[non_exhaustive]pub enum Algorithm {
Rsa,
ElGamal,
Dsa,
Ecdh,
Ecdsa,
Eddsa,
Sm2,
}Expand description
Public-key algorithm. Maps to the RNP_ALGNAME_* string constants in
rnp.h.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Rsa
"RSA". Used for primary or subkey; supports sign + encrypt (legacy).
ElGamal
"ELGAMAL". Subkey only, encryption.
Dsa
"DSA". Primary only, signing.
Ecdh
"ECDH". Subkey only, encryption.
Ecdsa
"ECDSA". Primary or subkey, signing.
Eddsa
"EDDSA". Primary or subkey, signing (Ed25519 curve).
Sm2
"SM2". Primary or subkey, sign + encrypt.
Implementations§
Source§impl Algorithm
impl Algorithm
pub fn as_str(self) -> &'static str
Sourcepub fn is_signature(self) -> bool
pub fn is_signature(self) -> bool
Whether this algorithm can produce signatures. Maps to OpenPGP’s “signing-capable” public-key algorithms (DSA, ECDSA, EdDSA, SM2, RSA). Useful for builder-time validation.
Sourcepub fn is_encryption(self) -> bool
pub fn is_encryption(self) -> bool
Whether this algorithm can perform public-key encryption / key encapsulation. Maps to OpenPGP’s encryption-capable algorithms (RSA, ECDH, ElGamal, SM2).
Trait Implementations§
impl Copy for Algorithm
impl Eq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnsafeUnpin for Algorithm
impl UnwindSafe for Algorithm
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