Enum ssh_key::private::KeypairData
source · #[non_exhaustive]pub enum KeypairData {
Dsa(DsaKeypair),
Ecdsa(EcdsaKeypair),
Ed25519(Ed25519Keypair),
Encrypted(Vec<u8>),
Rsa(RsaKeypair),
SkEcdsaSha2NistP256(SkEcdsaSha2NistP256),
SkEd25519(SkEd25519),
}
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.
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 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 Debug for KeypairData
impl Debug for KeypairData
source§impl From<DsaKeypair> for KeypairData
impl From<DsaKeypair> for KeypairData
source§fn from(keypair: DsaKeypair) -> KeypairData
fn from(keypair: DsaKeypair) -> KeypairData
source§impl From<EcdsaKeypair> for KeypairData
impl From<EcdsaKeypair> for KeypairData
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
impl From<RsaKeypair> for KeypairData
source§fn from(keypair: RsaKeypair) -> KeypairData
fn from(keypair: RsaKeypair) -> KeypairData
source§impl From<SkEcdsaSha2NistP256> for KeypairData
impl From<SkEcdsaSha2NistP256> for KeypairData
source§fn from(keypair: SkEcdsaSha2NistP256) -> KeypairData
fn from(keypair: SkEcdsaSha2NistP256) -> KeypairData
source§impl From<SkEd25519> for KeypairData
impl From<SkEd25519> for KeypairData
source§fn from(keypair: SkEd25519) -> KeypairData
fn from(keypair: SkEd25519) -> KeypairData
source§impl Signer<Signature> for KeypairData
impl Signer<Signature> for KeypairData
source§impl TryFrom<&KeypairData> for KeyData
impl TryFrom<&KeypairData> for KeyData
source§impl TryFrom<KeypairData> for PrivateKey
impl TryFrom<KeypairData> for PrivateKey
source§fn try_from(key_data: KeypairData) -> Result<PrivateKey>
fn try_from(key_data: KeypairData) -> Result<PrivateKey>
Auto Trait Implementations§
impl Freeze for KeypairData
impl RefUnwindSafe for KeypairData
impl Send for KeypairData
impl Sync for KeypairData
impl Unpin for KeypairData
impl UnwindSafe for KeypairData
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)