pub struct LaunchIdentity { /* private fields */ }Expand description
One launch’s identity material, generated by LaunchIdentity::generate.
Holds both secret halves, so it lives exactly as long as the launch needs it: the payload
fields are read out of it before the call, and LaunchIdentity::keep converts it into
the durable TunnelIdentity — which keeps the host secret and the public VM pin, and
drops the VM secret on the floor where it belongs.
Implementations§
Source§impl LaunchIdentity
impl LaunchIdentity
Sourcepub fn generate() -> Result<Self, Error>
pub fn generate() -> Result<Self, Error>
Fresh material from the OS random pool.
The all-zero retry is not reachable from a working pool; it exists because the protocol crate refuses a zero seed (a shared identity proves nothing), and this constructor must never hand out material the daemon would reject at bootstrap.
Sourcepub fn seed_field(&self) -> String
pub fn seed_field(&self) -> String
The payload value under protocol::identity::SEED_KEY: the VM seed, base64.
Sourcepub fn host_public_field(&self) -> String
pub fn host_public_field(&self) -> String
The payload value under protocol::identity::HOST_PUBLIC_KEY_KEY: the host public
key, base64. The public half — the secret never appears in any payload.
Sourcepub fn keep(self) -> TunnelIdentity
pub fn keep(self) -> TunnelIdentity
Converts into what outlives the launch: the host secret and the VM’s public pin.
The VM’s secret half ends here. After this call the host can verify its VM forever and impersonate it never, which is the least-privilege shape for a record that will sit in a ledger file: a stolen record lets an attacker check a VM’s identity, not forge one.
Trait Implementations§
Source§impl Debug for LaunchIdentity
Prints nothing but the fact that material exists. Both fields are private keys, and a
derived Debug would put them into any log line that formats a launch request.
impl Debug for LaunchIdentity
Prints nothing but the fact that material exists. Both fields are private keys, and a
derived Debug would put them into any log line that formats a launch request.
Auto Trait Implementations§
impl Freeze for LaunchIdentity
impl RefUnwindSafe for LaunchIdentity
impl Send for LaunchIdentity
impl Sync for LaunchIdentity
impl Unpin for LaunchIdentity
impl UnsafeUnpin for LaunchIdentity
impl UnwindSafe for LaunchIdentity
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> 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