#[non_exhaustive]pub enum KeyData {
Dsa(DsaPublicKey),
Ecdsa(EcdsaPublicKey),
Ed25519(Ed25519PublicKey),
Rsa(RsaPublicKey),
SkEcdsaSha2NistP256(SkEcdsaSha2NistP256),
SkEd25519(SkEd25519),
}
Expand description
Public key data.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Dsa(DsaPublicKey)
Digital Signature Algorithm (DSA) public key data.
Ecdsa(EcdsaPublicKey)
Elliptic Curve Digital Signature Algorithm (ECDSA) public key data.
Ed25519(Ed25519PublicKey)
Ed25519 public key data.
Rsa(RsaPublicKey)
RSA public key data.
SkEcdsaSha2NistP256(SkEcdsaSha2NistP256)
Security Key (FIDO/U2F) using ECDSA/NIST P-256 as specified in PROTOCOL.u2f.
SkEd25519(SkEd25519)
Security Key (FIDO/U2F) using Ed25519 as specified in PROTOCOL.u2f.
Implementations§
Source§impl KeyData
impl KeyData
Sourcepub fn dsa(&self) -> Option<&DsaPublicKey>
pub fn dsa(&self) -> Option<&DsaPublicKey>
Get DSA public key if this key is the correct type.
Sourcepub fn ecdsa(&self) -> Option<&EcdsaPublicKey>
pub fn ecdsa(&self) -> Option<&EcdsaPublicKey>
Get ECDSA public key if this key is the correct type.
Sourcepub fn ed25519(&self) -> Option<&Ed25519PublicKey>
pub fn ed25519(&self) -> Option<&Ed25519PublicKey>
Get Ed25519 public key if this key is the correct type.
Sourcepub fn fingerprint(&self, hash_alg: HashAlg) -> Fingerprint
pub fn fingerprint(&self, hash_alg: HashAlg) -> Fingerprint
Compute key fingerprint.
Use Default::default()
to use the default hash function (SHA-256).
Sourcepub fn rsa(&self) -> Option<&RsaPublicKey>
pub fn rsa(&self) -> Option<&RsaPublicKey>
Get RSA public key if this key is the correct type.
Sourcepub fn sk_ecdsa_p256(&self) -> Option<&SkEcdsaSha2NistP256>
pub fn sk_ecdsa_p256(&self) -> Option<&SkEcdsaSha2NistP256>
Get FIDO/U2F ECDSA/NIST P-256 public key if this key is the correct type.
Sourcepub fn sk_ed25519(&self) -> Option<&SkEd25519>
pub fn sk_ed25519(&self) -> Option<&SkEd25519>
Get FIDO/U2F Ed25519 public key if this key is the correct type.
Sourcepub fn is_ed25519(&self) -> bool
pub fn is_ed25519(&self) -> bool
Is this key an Ed25519 key?
Sourcepub fn is_sk_ecdsa_p256(&self) -> bool
pub fn is_sk_ecdsa_p256(&self) -> bool
Is this key a FIDO/U2F ECDSA/NIST P-256 key?
Sourcepub fn is_sk_ed25519(&self) -> bool
pub fn is_sk_ed25519(&self) -> bool
Is this key a FIDO/U2F Ed25519 key?