pub struct Session<T> {
pub tek: Key,
pub tik: Key,
/* private fields */
}Expand description
Describes a secure channel with the HYGON SP.
This is required for facilitating an CSV launch and attestation.
Fields§
§tek: KeyTransport Encryption Key.
tik: KeyTransport Integrity Key.
Implementations§
Source§impl Session<Initialized>
impl Session<Initialized>
Sourcepub fn start(&self, chain: Chain) -> Result<Start>
pub fn start(&self, chain: Chain) -> Result<Start>
Produces data needed to initiate the CSV launch sequence.
Sourcepub fn start_pdh(&self, pdh: Certificate) -> Result<Start>
pub fn start_pdh(&self, pdh: Certificate) -> Result<Start>
Like the above start function, yet takes PDH as input instead of deriving it from a certificate chain.
Sourcepub fn measure(self) -> Result<Session<Measuring>>
pub fn measure(self) -> Result<Session<Measuring>>
Transitions to a measuring state.
Any measureable data submitted to the HYGON SP should also be included
in the Session to easily compare against the HYGON SP’s measurement.
Sourcepub fn verify(
self,
_digest: &[u8],
_build: Build,
msr: Measurement,
) -> Result<Session<Verified>>
pub fn verify( self, _digest: &[u8], _build: Build, msr: Measurement, ) -> Result<Session<Verified>>
Verifies the HYGON SP’s measurement.
Sourcepub unsafe fn mock_verify(self, msr: Measurement) -> Result<Session<Verified>>
pub unsafe fn mock_verify(self, msr: Measurement) -> Result<Session<Verified>>
Skip verifying the measurement
§Safety
This method must only be used in tests or unattested workflows.
Source§impl Session<Measuring>
impl Session<Measuring>
Sourcepub fn update_data(&mut self, data: &[u8]) -> Result<()>
pub fn update_data(&mut self, data: &[u8]) -> Result<()>
Adds additional data to the digest.
Everything measured by the HYGON SP should also be measured by
the Session to ensure both measurements are the same.
Sourcepub fn verify(self, build: Build, msr: Measurement) -> Result<Session<Verified>>
pub fn verify(self, build: Build, msr: Measurement) -> Result<Session<Verified>>
Verifies the session’s measurement against the HYGON SP’s measurement.
Sourcepub fn verify_with_digest(
self,
build: Build,
msr: Measurement,
digest: &[u8],
) -> Result<Session<Verified>>
pub fn verify_with_digest( self, build: Build, msr: Measurement, digest: &[u8], ) -> Result<Session<Verified>>
Verifies the session’s measurement against the HYGON SP’s measurement using an externally generated digest.