pub struct TunnelIdentity { /* private fields */ }Expand description
What a launcher keeps to verify its VM later: its own secret, and the VM’s public pin.
Implementations§
Source§impl TunnelIdentity
impl TunnelIdentity
Sourcepub fn from_parts(
host_seed: &[u8],
vm_public_key: &[u8],
) -> Result<TunnelIdentity, Error>
pub fn from_parts( host_seed: &[u8], vm_public_key: &[u8], ) -> Result<TunnelIdentity, Error>
Rebuilds from the two values a ledger record carries.
host_seed is validated with the shared rules; the public key only for length,
because a public key has no all-zero hazard — it is derived, not generated, and the
zero check exists to catch a broken RNG at generation time.
Sourcepub fn vm_public_key(&self) -> [u8; 32]
pub fn vm_public_key(&self) -> [u8; 32]
The VM’s public key — the pin. Safe to store, print, and compare.
Sourcepub fn host_seed(&self) -> [u8; 32]
pub fn host_seed(&self) -> [u8; 32]
The host’s secret half, for a ledger record.
Exposed because the CLI’s registry must persist it (0600, beside the agent token it
already holds) for tunnel --name to verify in a later process. Callers other than a
persistence layer have no business with it — the initiator below is the way to use
the identity.
Sourcepub fn host_seed_base64(&self) -> String
pub fn host_seed_base64(&self) -> String
The host secret in its wire spelling — standard base64 — for a registry record.
Here rather than in each consumer, so the CLI (whose manifest deliberately carries no
encoding crates) and the record it writes cannot disagree with
TunnelIdentity::from_encoded_parts about alphabet or padding.
Sourcepub fn vm_public_key_base64(&self) -> String
pub fn vm_public_key_base64(&self) -> String
The pin in its wire spelling.
Sourcepub fn from_encoded_parts(
host_seed: &str,
vm_public_key: &str,
) -> Result<TunnelIdentity, Error>
pub fn from_encoded_parts( host_seed: &str, vm_public_key: &str, ) -> Result<TunnelIdentity, Error>
TunnelIdentity::from_parts, from the base64 spellings a record or a flag carries.
Trait Implementations§
Source§impl Clone for TunnelIdentity
impl Clone for TunnelIdentity
Source§fn clone(&self) -> TunnelIdentity
fn clone(&self) -> TunnelIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TunnelIdentity
The pin is printable; the host seed is not.
impl Debug for TunnelIdentity
The pin is printable; the host seed is not.
Source§impl TunnelIdentityExt for TunnelIdentity
impl TunnelIdentityExt for TunnelIdentity
Auto Trait Implementations§
impl Freeze for TunnelIdentity
impl RefUnwindSafe for TunnelIdentity
impl Send for TunnelIdentity
impl Sync for TunnelIdentity
impl Unpin for TunnelIdentity
impl UnsafeUnpin for TunnelIdentity
impl UnwindSafe for TunnelIdentity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more