Enum thrussh_keys::key::KeyPair [−][src]
pub enum KeyPair { Ed25519(SecretKey), RSA { key: Rsa<Private>, hash: SignatureHash, }, }
Public key exchange algorithms.
Variants
Ed25519(SecretKey)
RSA
Fields of RSA
key: Rsa<Private> | |
hash: SignatureHash |
Methods
impl KeyPair
[src]
impl KeyPair
pub fn clone_public_key(&self) -> PublicKey
[src]
pub fn clone_public_key(&self) -> PublicKey
Copy the public key of this algorithm.
pub fn name(&self) -> &'static str
[src]
pub fn name(&self) -> &'static str
Name of this key algorithm.
pub fn generate_ed25519() -> Option<Self>
[src]
pub fn generate_ed25519() -> Option<Self>
Generate a key pair.
pub fn generate_rsa(bits: usize, hash: SignatureHash) -> Option<Self>
[src]
pub fn generate_rsa(bits: usize, hash: SignatureHash) -> Option<Self>
pub fn sign_detached(&self, to_sign: &[u8]) -> Result<Signature, Error>
[src]
pub fn sign_detached(&self, to_sign: &[u8]) -> Result<Signature, Error>
Sign a slice using this algorithm.
Trait Implementations
impl Debug for KeyPair
[src]
impl Debug for KeyPair
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PublicKeyBase64 for KeyPair
[src]
impl PublicKeyBase64 for KeyPair
fn public_key_base64(&self) -> String
[src]
fn public_key_base64(&self) -> String
Create the base64 part of the public key blob.