Struct mz_ssh_util::keys::SshKeyPairSet
source · [−]pub struct SshKeyPairSet { /* private fields */ }
Expand description
A set of two SSH key pairs, used to support key rotation.
When a key pair set is rotated, the secondary key pair becomes the new primary key pair, and a new secondary key pair is generated.
Implementations
sourceimpl SshKeyPairSet
impl SshKeyPairSet
sourcepub fn new() -> Result<SshKeyPairSet, Error>
pub fn new() -> Result<SshKeyPairSet, Error>
Generates a new key pair set with random key pairs.
sourcepub fn rotate(&self) -> Result<SshKeyPairSet, Error>
pub fn rotate(&self) -> Result<SshKeyPairSet, Error>
Rotate the key pairs in the set.
The rotation promotes the secondary key_pair to primary and generates a new random secondary key pair.
sourcepub fn public_keys(&self) -> (String, String)
pub fn public_keys(&self) -> (String, String)
Returns the primary and secondary public keys in the set.
sourcepub fn primary(&self) -> &SshKeyPair
pub fn primary(&self) -> &SshKeyPair
Return the primary key pair.
sourcepub fn secondary(&self) -> &SshKeyPair
pub fn secondary(&self) -> &SshKeyPair
Returns the secondary pair.
sourcepub fn to_bytes(&self) -> Zeroizing<Vec<u8>>
pub fn to_bytes(&self) -> Zeroizing<Vec<u8>>
Serializes the key pair set to an unspecified encoding.
You can deserialize a key pair set with SshKeyPairSet::deserialize
.
sourcepub fn from_bytes(data: &[u8]) -> Result<SshKeyPairSet>
pub fn from_bytes(data: &[u8]) -> Result<SshKeyPairSet>
Deserializes a key pair set that was serialized with
SshKeyPairSet::serialize
.
Trait Implementations
sourceimpl Clone for SshKeyPairSet
impl Clone for SshKeyPairSet
sourcefn clone(&self) -> SshKeyPairSet
fn clone(&self) -> SshKeyPairSet
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 SshKeyPairSet
impl Debug for SshKeyPairSet
sourceimpl<'de> Deserialize<'de> for SshKeyPairSet
impl<'de> Deserialize<'de> for SshKeyPairSet
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<SshKeyPairSet> for SshKeyPairSet
impl PartialEq<SshKeyPairSet> for SshKeyPairSet
sourcefn eq(&self, other: &SshKeyPairSet) -> bool
fn eq(&self, other: &SshKeyPairSet) -> bool
sourceimpl Serialize for SshKeyPairSet
impl Serialize for SshKeyPairSet
impl Eq for SshKeyPairSet
impl StructuralEq for SshKeyPairSet
impl StructuralPartialEq for SshKeyPairSet
Auto Trait Implementations
impl RefUnwindSafe for SshKeyPairSet
impl Send for SshKeyPairSet
impl Sync for SshKeyPairSet
impl Unpin for SshKeyPairSet
impl UnwindSafe for SshKeyPairSet
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.