EnrollmentBlob

Struct EnrollmentBlob 

Source
pub struct EnrollmentBlob {
    pub version: u8,
    pub key_fingerprint: String,
    pub key_type: SshKeyType,
    pub nonce: [u8; 12],
    pub ciphertext: Vec<u8>,
}
Expand description

Parsed enrollment blob.

Binary format:

Version byte (1 byte): 0x01
Key fingerprint length (2 bytes, BE): N
Key fingerprint (N bytes): SHA256:... (ASCII)
Key type length (1 byte): M
Key type (M bytes): "ssh-ed25519" or "ssh-rsa" (ASCII)
Nonce (12 bytes): random
Ciphertext + GCM tag (48 bytes): AES-256-GCM(kek, master_key)

Fields§

§version: u8§key_fingerprint: String§key_type: SshKeyType§nonce: [u8; 12]§ciphertext: Vec<u8>

32 bytes master key + 16 bytes GCM tag = 48 bytes.

Implementations§

Source§

impl EnrollmentBlob

Source

pub fn serialize(&self) -> Vec<u8>

Serialize to the binary wire format.

Source

pub fn deserialize(data: &[u8]) -> Result<Self, AuthError>

Deserialize from the binary wire format.

§Errors

Returns AuthError::InvalidBlob if the data is truncated, has an unsupported version, or contains an invalid key type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more