Struct mz_ssh_util::keys::SshKeyPairSet
source · pub struct SshKeyPairSet {
primary: SshKeyPair,
secondary: SshKeyPair,
}
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.
Fields§
§primary: SshKeyPair
§secondary: SshKeyPair
Implementations§
source§impl SshKeyPairSet
impl SshKeyPairSet
pub fn new() -> Result<SshKeyPairSet, Error>
sourcepub fn from_parts(primary: SshKeyPair, secondary: SshKeyPair) -> SshKeyPairSet
pub fn from_parts(primary: SshKeyPair, secondary: SshKeyPair) -> SshKeyPairSet
Creates a new key pair set from an existing primary and secondary key pair.
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§
source§impl Clone for SshKeyPairSet
impl Clone for SshKeyPairSet
source§fn clone(&self) -> SshKeyPairSet
fn clone(&self) -> SshKeyPairSet
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 SshKeyPairSet
impl Debug for SshKeyPairSet
source§impl<'de> Deserialize<'de> for SshKeyPairSet
impl<'de> Deserialize<'de> for SshKeyPairSet
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 PartialEq for SshKeyPairSet
impl PartialEq for SshKeyPairSet
source§impl Serialize for SshKeyPairSet
impl Serialize for SshKeyPairSet
impl Eq for SshKeyPairSet
impl StructuralPartialEq for SshKeyPairSet
Auto Trait Implementations§
impl Freeze for SshKeyPairSet
impl RefUnwindSafe for SshKeyPairSet
impl Send for SshKeyPairSet
impl Sync for SshKeyPairSet
impl Unpin for SshKeyPairSet
impl UnwindSafe for SshKeyPairSet
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> 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