Struct mz_ore::ssh_key::SshKeypair
source · [−]pub struct SshKeypair {
keypair: PrivateKey,
}
Available on crate feature
ssh
only.Expand description
Keeps track of a public-private keypair, stored in the OpenSSH format
Fields
keypair: PrivateKey
Implementations
sourceimpl SshKeypair
impl SshKeypair
sourcepub fn new() -> Result<SshKeypair, Error>
pub fn new() -> Result<SshKeypair, Error>
Generate a new keypair for SSH connections.
Ed25519 keys are generated via OpenSSL, using ssh_key
to convert
them into the proprietary OpenSSH format.
sourcefn from_private_key(private_key: &[u8]) -> Result<SshKeypair, Error>
fn from_private_key(private_key: &[u8]) -> Result<SshKeypair, Error>
Deserialize a keypair from a private key
In the OpenSSH format, the public key is embedded inside the private key
sourcepub fn ssh_public_key(&self) -> String
pub fn ssh_public_key(&self) -> String
Return 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
sourceimpl Clone for SshKeypair
impl Clone for SshKeypair
sourcefn clone(&self) -> SshKeypair
fn clone(&self) -> SshKeypair
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for SshKeypair
impl Debug for SshKeypair
sourceimpl<'de> Deserialize<'de> for SshKeypair
impl<'de> Deserialize<'de> for SshKeypair
sourcefn 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
sourceimpl PartialEq<SshKeypair> for SshKeypair
impl PartialEq<SshKeypair> for SshKeypair
sourceimpl Serialize for SshKeypair
impl Serialize for SshKeypair
impl Eq for SshKeypair
Auto Trait Implementations
impl RefUnwindSafe for SshKeypair
impl Send for SshKeypair
impl Sync for SshKeypair
impl Unpin for SshKeypair
impl UnwindSafe for SshKeypair
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request