pub struct LaunchIdentity { /* private fields */ }Expand description
One launch’s identity material, built by LaunchIdentity::from_seeds.
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 from_seeds(
vm_seed: [u8; 32],
host_seed: [u8; 32],
) -> Result<LaunchIdentity, Error>
pub fn from_seeds( vm_seed: [u8; 32], host_seed: [u8; 32], ) -> Result<LaunchIdentity, Error>
The material for vm_seed and host_seed, validated the way the daemon validates
them at bootstrap.
The seeds are the caller’s: this crate doesn’t read the OS random pool (ARCH-6).
microvms_core::prelude::LaunchIdentityExt::generate draws fresh ones, which is what
a launch wants. seed_from_bytes is the shared validation the daemon runs at
bootstrap; running it here makes “the host accepted what the daemon will refuse”
unrepresentable.
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.
Source§impl LaunchIdentityExt for LaunchIdentity
impl LaunchIdentityExt for LaunchIdentity
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