Skip to main content

Module sui::nitro_attestation

use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::vector;
use sui::address;
use sui::clock;
use sui::hex;
use sui::object;
use sui::transfer;
use sui::tx_context;

Struct NitroAttestationDocument

Nitro Attestation Document defined for AWS.

public struct NitroAttestationDocument has copy, drop, store
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<vector<u8>>
The map of all locked PCRs at the moment the attestation document was generated. The array contains PCR0, PCR1, PCR2, PCR3, PCR4, PCR8. See more .
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 input failed to be parsed.

const EParseError: u64 = 1;

Error that the attestation failed to be verified.

const EVerifyError: u64 = 2;

Function verify_nitro_attestation_internal

Internal native function

fun verify_nitro_attestation_internal(attestation: &vector<u8>, current_timestamp: u64): sui::nitro_attestation::NitroAttestationDocument
Click to open
Implementation
native fun verify_nitro_attestation_internal(
    attestation: &vector<u8>,
    current_timestamp: u64
): NitroAttestationDocument;

Function verify_nitro_attestation

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

Returns parsed NitroAttestationDocument after verifying the attestation.

public fun verify_nitro_attestation(attestation: &vector<u8>, clock: &sui::clock::Clock): sui::nitro_attestation::NitroAttestationDocument
Click to open
Implementation
public fun verify_nitro_attestation(
    attestation: &vector<u8>,
    clock: &Clock
): NitroAttestationDocument {
    verify_nitro_attestation_internal(attestation, clock::timestamp_ms(clock))
}

Function module_id

public fun module_id(attestation: &sui::nitro_attestation::NitroAttestationDocument): vector<u8>
Click to open
Implementation
public fun module_id(attestation: &NitroAttestationDocument): vector<u8> {
    attestation.module_id
}

Function timestamp

public fun timestamp(attestation: &sui::nitro_attestation::NitroAttestationDocument): u64
Click to open
Implementation
public fun timestamp(attestation: &NitroAttestationDocument): u64 {
    attestation.timestamp
}

Function digest

public fun digest(attestation: &sui::nitro_attestation::NitroAttestationDocument): vector<u8>
Click to open
Implementation
public fun digest(attestation: &NitroAttestationDocument): vector<u8> {
    attestation.digest
}

Function get_pcrs

public fun get_pcrs(attestation: &sui::nitro_attestation::NitroAttestationDocument): vector<vector<u8>>
Click to open
Implementation
public fun get_pcrs(attestation: &NitroAttestationDocument): vector<vector<u8>> {
    attestation.pcrs
}

Function public_key

public fun public_key(attestation: &sui::nitro_attestation::NitroAttestationDocument): std::option::Option<vector<u8>>
Click to open
Implementation
public fun public_key(attestation: &NitroAttestationDocument): Option<vector<u8>> {
    attestation.public_key
}

Function user_data

public fun user_data(attestation: &sui::nitro_attestation::NitroAttestationDocument): std::option::Option<vector<u8>>
Click to open
Implementation
public fun user_data(attestation: &NitroAttestationDocument): Option<vector<u8>> {
    attestation.user_data
}

Function nonce

public fun nonce(attestation: &sui::nitro_attestation::NitroAttestationDocument): std::option::Option<vector<u8>>
Click to open
Implementation
public fun nonce(attestation: &NitroAttestationDocument): Option<vector<u8>> {
    attestation.nonce
}