Struct mz_ssh_util::keys::SshKeyPair
source · pub struct SshKeyPair {
key_pair: PrivateKey,
}
Expand description
A SSH key pair consisting of a public and private key.
Fields§
§key_pair: PrivateKey
Implementations§
source§impl SshKeyPair
impl SshKeyPair
sourcepub fn new() -> Result<SshKeyPair, Error>
pub fn new() -> Result<SshKeyPair, Error>
Generates a new SSH key pair.
Ed25519 keys are generated via OpenSSL, using ssh_key
to convert
them into the OpenSSH format.
sourcepub fn from_bytes(data: &[u8]) -> Result<SshKeyPair>
pub fn from_bytes(data: &[u8]) -> Result<SshKeyPair>
Deserializes a key pair from a key pair set that was serialized with
SshKeyPairSet::serialize
.
sourcefn from_private_key(private_key: &[u8]) -> Result<SshKeyPair, Error>
fn from_private_key(private_key: &[u8]) -> Result<SshKeyPair, Error>
Deserializes a key pair from an OpenSSH-formatted private key.
sourcepub fn ssh_public_key(&self) -> String
pub fn ssh_public_key(&self) -> String
Returns the public key encoded in the OpenSSH format.
sourcepub fn ssh_private_key(&self) -> Zeroizing<String>
pub fn ssh_private_key(&self) -> Zeroizing<String>
Return the private key encoded in the OpenSSH format.
Trait Implementations§
source§impl Clone for SshKeyPair
impl Clone for SshKeyPair
source§fn clone(&self) -> SshKeyPair
fn clone(&self) -> SshKeyPair
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SshKeyPair
impl Debug for SshKeyPair
source§impl<'de> Deserialize<'de> for SshKeyPair
impl<'de> Deserialize<'de> for SshKeyPair
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for SshKeyPair
impl Ord for SshKeyPair
source§impl PartialEq for SshKeyPair
impl PartialEq for SshKeyPair
source§impl PartialOrd for SshKeyPair
impl PartialOrd for SshKeyPair
source§impl Serialize for SshKeyPair
impl Serialize for SshKeyPair
impl Eq for SshKeyPair
Auto Trait Implementations§
impl Freeze for SshKeyPair
impl RefUnwindSafe for SshKeyPair
impl Send for SshKeyPair
impl Sync for SshKeyPair
impl Unpin for SshKeyPair
impl UnwindSafe for SshKeyPair
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request