Skip to main content

Module sui::nitro_attestation

Struct PCREntry

Represents a PCR entry with an index and value.

public struct PCREntry has drop
Click to open
Fields
index: u8
value: vector<u8>

Struct NitroAttestationDocument

Nitro Attestation Document defined for AWS.

public struct NitroAttestationDocument has drop
Click to open
Fields
module_id: vector<u8>
Issuing Nitro hypervisor module ID.
timestamp: u64
UTC time when document was created, in milliseconds since UNIX epoch.
digest: vector<u8>
The digest function used for calculating the register values.
pcrs: vector<sui::nitro_attestation::PCREntry>
A list of PCREntry containing the index and the PCR bytes. .
public_key: std::option::Option<vector<u8>>
An optional DER-encoded key the attestation, consumer can use to encrypt data with.
user_data: std::option::Option<vector<u8>>
Additional signed user data, defined by protocol.
nonce: std::option::Option<vector<u8>>
An optional cryptographic nonce provided by the attestation consumer as a proof of authenticity.

Constants

Error that the feature is not available on this network.

const ENotSupportedError: u64 = 0;

Error that the attestation input failed to be parsed.

const EParseError: u64 = 1;

Error that the attestation failed to be verified.

const EVerifyError: u64 = 2;

Error that the PCRs are invalid.

const EInvalidPCRsError: u64 = 3;

Function load_nitro_attestation

@param attestation: attesttaion documents bytes data. @param clock: the clock object.

Returns the parsed NitroAttestationDocument after verifying the attestation, may abort with errors described above.

Function module_id

public fun module_id(attestation: &sui::nitro_attestation::NitroAttestationDocument): &vector<u8>

Function timestamp

Function digest

public fun digest(attestation: &sui::nitro_attestation::NitroAttestationDocument): &vector<u8>

Function pcrs

Returns a list of mapping PCREntry containg the index and the PCR bytes.
AWS supports PCR0-31. Required PCRs (index 0-4 & 8) are always included regardless of their value. Additional custom PCRs (index 5-7, 9-31) are also included if they are nonzeros.

Function public_key

Function user_data

Function nonce

Function index

public fun index(entry: &sui::nitro_attestation::PCREntry): u8

Function value

public fun value(entry: &sui::nitro_attestation::PCREntry): &vector<u8>

Function load_nitro_attestation_internal

Internal native function

fun load_nitro_attestation_internal(attestation: &vector<u8>, current_timestamp: u64): sui::nitro_attestation::NitroAttestationDocument