AttestationHandler

Trait AttestationHandler 

Source
pub trait AttestationHandler<AccountId> {
    // Required methods
    fn verify_quote(
        attestee: &AccountId,
        x25519_public_key: X25519PublicKey,
        quote: Vec<u8>,
        context: QuoteContext,
    ) -> Result<BoundedVecEncodedVerifyingKey, VerifyQuoteError>;
    fn request_quote(attestee: &AccountId, nonce: [u8; 32]);
}
Expand description

A trait for types which can handle attestation requests.

Required Methods§

Source

fn verify_quote( attestee: &AccountId, x25519_public_key: X25519PublicKey, quote: Vec<u8>, context: QuoteContext, ) -> Result<BoundedVecEncodedVerifyingKey, VerifyQuoteError>

Verify that the given quote is valid and matches the given information about the attestee. The Provisioning Certification Key (PCK) certifcate chain is extracted from the quote and verified. If successful, the PCK public key used to sign the quote is returned.

Source

fn request_quote(attestee: &AccountId, nonce: [u8; 32])

Indicate to the attestation handler that a quote is desired.

The nonce should be a piece of data (e.g a random number) which indicates that the quote is reasonably fresh and has not been reused.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<AccountId> AttestationHandler<AccountId> for ()

A convenience implementation for testing and benchmarking.

Source§

fn verify_quote( _attestee: &AccountId, _x25519_public_key: X25519PublicKey, _quote: Vec<u8>, _context: QuoteContext, ) -> Result<BoundedVecEncodedVerifyingKey, VerifyQuoteError>

Source§

fn request_quote(_attestee: &AccountId, _nonce: [u8; 32])

Implementors§