attest

package
v0.0.0-...-d7368f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValidatingNonce = errors.New("error validating nonce")

Functions

func GetAttestationDoc

func GetAttestationDoc(publicKey []byte, nonce []byte, userData []byte) ([]byte, error)

func GetRootAWSCert

func GetRootAWSCert() (*x509.Certificate, error)

Types

type AttestationDoc

type AttestationDoc struct {
	ModuleID    string `cbor:"module_id"`
	Timestamp   uint64
	Digest      string
	PCRs        map[int][]byte
	Certificate []byte
	Cabundle    [][]byte
	PublicKey   []byte `cbor:"public_key"`
	UserData    []byte `cbor:"user_data"`
	Nonce       []byte `cbor:"nonce"`
}

func ParseAttestationDocument

func ParseAttestationDocument(attestation []byte) (*AttestationDoc, error)

ParseAttestationDocument is a utility method to return a Attestation Document without actually verifying it. Useful for if you need some info out of the document but you don't need to verify it.

type Manager

type Manager struct {
	PublicKey []byte
}

func (Manager) GetAttestationDocWithPublicKey

func (m Manager) GetAttestationDocWithPublicKey(pk []byte, nonce []byte, userData []byte) ([]byte, error)

func (Manager) GetAttestationDocument

func (m Manager) GetAttestationDocument(nonce []byte, userData []byte) ([]byte, error)

type NSM

type NSM interface {
	Send(req request.Request) (response.Response, error)
}

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func NewVerifier

func NewVerifier(opts ...VerifierOpt) *Verifier

func (*Verifier) Verify

func (v *Verifier) Verify(attestation []byte, nonce []byte) (*AttestationDoc, error)

type VerifierOpt

type VerifierOpt func(*Verifier)

func WithCurrentTime

func WithCurrentTime(time time.Time) VerifierOpt

func WithRootCert

func WithRootCert(rootCert *x509.Certificate) VerifierOpt

WithRootCert sets the root certificate to use. By default attestation uses the aws root certificate.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL