#[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)
alloc only.Digital Signature Algorithm (DSA) keypair.
Ecdsa(EcdsaKeypair)
ecdsa only.ECDSA keypair.
Ed25519(Ed25519Keypair)
Ed25519 keypair.
Encrypted(Vec<u8>)
alloc only.Encrypted private key (ciphertext).
Rsa(RsaKeypair)
alloc only.RSA keypair.
SkEcdsaSha2NistP256(SkEcdsaSha2NistP256)
alloc and ecdsa only.Security Key (FIDO/U2F) using ECDSA/NIST P-256 as specified in PROTOCOL.u2f.
SkEd25519(SkEd25519)
alloc only.Security Key (FIDO/U2F) using Ed25519 as specified in PROTOCOL.u2f.
Other(OpaqueKeypair)
alloc only.Opaque keypair.
Implementations§
Source§impl KeypairData
impl KeypairData
Sourcepub fn dsa(&self) -> Option<&DsaKeypair>
Available on crate feature alloc only.
pub fn dsa(&self) -> Option<&DsaKeypair>
alloc only.Get DSA keypair if this key is the correct type.
Sourcepub fn ecdsa(&self) -> Option<&EcdsaKeypair>
Available on crate feature ecdsa only.
pub fn ecdsa(&self) -> Option<&EcdsaKeypair>
ecdsa only.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]>
Available on crate feature alloc only.
pub fn encrypted(&self) -> Option<&[u8]>
alloc only.Get the encrypted ciphertext if this key is encrypted.
Sourcepub fn rsa(&self) -> Option<&RsaKeypair>
Available on crate feature alloc only.
pub fn rsa(&self) -> Option<&RsaKeypair>
alloc only.Get RSA keypair if this key is the correct type.
Sourcepub fn sk_ecdsa_p256(&self) -> Option<&SkEcdsaSha2NistP256>
Available on crate features alloc and ecdsa only.
pub fn sk_ecdsa_p256(&self) -> Option<&SkEcdsaSha2NistP256>
alloc and ecdsa only.Get FIDO/U2F ECDSA/NIST P-256 private key if this key is the correct type.
Sourcepub fn sk_ed25519(&self) -> Option<&SkEd25519>
Available on crate feature alloc only.
pub fn sk_ed25519(&self) -> Option<&SkEd25519>
alloc only.Get FIDO/U2F Ed25519 private key if this key is the correct type.
Sourcepub fn other(&self) -> Option<&OpaqueKeypair>
Available on crate feature alloc only.
pub fn other(&self) -> Option<&OpaqueKeypair>
alloc only.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
Available on crate feature alloc only.
pub fn is_encrypted(&self) -> bool
alloc only.Is this key encrypted?
Sourcepub fn is_sk_ecdsa_p256(&self) -> bool
Available on crate features alloc and ecdsa only.
pub fn is_sk_ecdsa_p256(&self) -> bool
alloc and ecdsa only.Is this key a FIDO/U2F ECDSA/NIST P-256 key?
Sourcepub fn is_sk_ed25519(&self) -> bool
Available on crate feature alloc only.
pub fn is_sk_ed25519(&self) -> bool
alloc only.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.Source§impl From<DsaKeypair> for KeypairData
Available on crate feature alloc only.
impl From<DsaKeypair> for KeypairData
alloc only.Source§fn from(keypair: DsaKeypair) -> KeypairData
fn from(keypair: DsaKeypair) -> KeypairData
Source§impl From<EcdsaKeypair> for KeypairData
Available on crate feature ecdsa only.
impl From<EcdsaKeypair> for KeypairData
ecdsa only.Source§fn from(keypair: EcdsaKeypair) -> KeypairData
fn from(keypair: EcdsaKeypair) -> KeypairData
Source§impl From<Ed25519Keypair> for KeypairData
impl From<Ed25519Keypair> for KeypairData
Source§fn from(keypair: Ed25519Keypair) -> KeypairData
fn from(keypair: Ed25519Keypair) -> KeypairData
Source§impl From<RsaKeypair> for KeypairData
Available on crate feature alloc only.
impl From<RsaKeypair> for KeypairData
alloc only.Source§fn from(keypair: RsaKeypair) -> KeypairData
fn from(keypair: RsaKeypair) -> KeypairData
Source§impl From<SkEcdsaSha2NistP256> for KeypairData
Available on crate features alloc and ecdsa only.
impl From<SkEcdsaSha2NistP256> for KeypairData
alloc and ecdsa only.Source§fn from(keypair: SkEcdsaSha2NistP256) -> KeypairData
fn from(keypair: SkEcdsaSha2NistP256) -> KeypairData
Source§impl From<SkEd25519> for KeypairData
Available on crate feature alloc only.
impl From<SkEd25519> for KeypairData
alloc only.Source§fn from(keypair: SkEd25519) -> KeypairData
fn from(keypair: SkEd25519) -> KeypairData
Source§impl PartialEq for KeypairData
impl PartialEq for KeypairData
Source§impl Signer<Signature> for KeypairData
Available on crate feature alloc only.
impl Signer<Signature> for KeypairData
alloc only.