brodyxchen / nitrite

Easily verify Nitro Enclave attestations with Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nitrite

Go Report Card Go Reference

A library for verifying AWS Nitro Enclave attestations for Go.

Usage

It's fairly simple to use it, so here's an example:

import (
	"bytes"
	"github.com/hf/nitrite"
	"time"
)

func verifyAttestation(attestation []byte) error {
	res, err := nitrite.Verify(
		bytes.NewReader(attestation),
		nitrite.VerifyOptions{
			CurrentTime: time.Now(),
		})

	if nil != err {
		return err
	}

	return nil
}

This package includes the Nitro Enclave Root CA certificates.

It's recommended you explicitly calculate the SHA256 sum of the DefaultRootCA string and match it according to the AWS documentation at the start of your application. Alternatively, you can supply your own copy of the root CA.

License

Copyright © 2021 Stojan Dimitrovski. Licensed under the MIT License. See LICENSE for more information.

About

Easily verify Nitro Enclave attestations with Go.

License:MIT License


Languages

Language:Go 99.2%Language:Vim Script 0.8%