#[non_exhaustive]pub enum KeypairData {
Dsa(DsaKeypair),
Ecdsa(EcdsaKeypair),
Ed25519(Ed25519Keypair),
Encrypted(Vec<u8>),
Rsa(RsaKeypair),
SkEcdsaSha2NistP256(SkEcdsaSha2NistP256),
SkEd25519(SkEd25519),
Other(OpaqueKeypair),
}
Expand description
Private key data: digital signature key pairs.
SSH private keys contain pairs of public and private keys for various supported digital signature algorithms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Dsa(DsaKeypair)
Digital Signature Algorithm (DSA) keypair.
Ecdsa(EcdsaKeypair)
ECDSA keypair.
Ed25519(Ed25519Keypair)
Ed25519 keypair.
Encrypted(Vec<u8>)
Encrypted private key (ciphertext).
Rsa(RsaKeypair)
RSA keypair.
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.
Other(OpaqueKeypair)
Opaque keypair.
Implementations§
Source§impl KeypairData
impl KeypairData
Sourcepub fn dsa(&self) -> Option<&DsaKeypair>
pub fn dsa(&self) -> Option<&DsaKeypair>
Get DSA keypair if this key is the correct type.
Sourcepub fn ecdsa(&self) -> Option<&EcdsaKeypair>
pub fn ecdsa(&self) -> Option<&EcdsaKeypair>
Get ECDSA private key if this key is the correct type.
Sourcepub fn ed25519(&self) -> Option<&Ed25519Keypair>
pub fn ed25519(&self) -> Option<&Ed25519Keypair>
Get Ed25519 private key if this key is the correct type.
Sourcepub fn encrypted(&self) -> Option<&[u8]>
pub fn encrypted(&self) -> Option<&[u8]>
Get the encrypted ciphertext if this key is encrypted.
Sourcepub fn rsa(&self) -> Option<&RsaKeypair>
pub fn rsa(&self) -> Option<&RsaKeypair>
Get RSA keypair 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 private 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 private key if this key is the correct type.
Sourcepub fn other(&self) -> Option<&OpaqueKeypair>
pub fn other(&self) -> Option<&OpaqueKeypair>
Get the custom, opaque private 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_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Is this key encrypted?
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?
Trait Implementations§
Source§impl Clone for KeypairData
impl Clone for KeypairData
Source§fn clone(&self) -> KeypairData
fn clone(&self) -> KeypairData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl ConstantTimeEq for KeypairData
impl ConstantTimeEq for KeypairData
Source§impl Debug for KeypairData
impl Debug for KeypairData
Source§impl Decode for KeypairData
impl Decode for KeypairData
Source§impl Encode for KeypairData
impl Encode for KeypairData
Source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
Writer
.Source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32
length prefix.Source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32
length prefix
set to Encode::encoded_len
.