pub struct PrivateKey {
pub key_type: KeyType,
pub kind: PrivateKeyKind,
pub pubkey: PublicKey,
pub comment: Option<String>,
}Expand description
A type which represents an OpenSSH public key.
Fields§
§key_type: KeyTypeKey type.
kind: PrivateKeyKindThe kind of public key.
pubkey: PublicKeyThe corresponding public key
comment: Option<String>Associated comment, if any.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<PrivateKey, Error>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<PrivateKey, Error>
Reads an OpenSSH private key from a given path.
Sourcepub fn from_string(contents: &str) -> Result<PrivateKey, Error>
pub fn from_string(contents: &str) -> Result<PrivateKey, Error>
Reads an OpenSSH private key from a given string.
Trait Implementations§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
Returns a duplicate 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 PrivateKey
impl Debug for PrivateKey
Source§impl PartialEq for PrivateKey
impl PartialEq for PrivateKey
impl StructuralPartialEq for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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