This is the beta version of Go Library for integrating with Intel Project Amber V1 API.
Install the latest version of the library with the following commands:
go get github.com/intel/amber-client/go-client
Use go1.17 or newer.
Create a new Project Amber client, then use the exposed services to access different parts of the Project Amber API.
import amberclient "github.com/intel/amber-client/go-client"
cfg := amberclient.Config{
// Replace AMBER_API_URL with real Amber URL
Url: "AMBER_API_URL",
// Provide TLS config
TlsCfg: &tls.Config{},
// Replace AMBER_API_KEY with your real key
ApiKey: "AMBER_API_KEY",
}
client, err := amberclient.New(&cfg)
nonce, err := client.GetNonce()
if err != nil {
fmt.Printf("Something bad happened: %s\n\n", err)
return err
}
token, err := client.GetToken(nonce, policyIds, evidence)
if err != nil {
fmt.Printf("Something bad happened: %s\n\n", err)
return err
}
parsedToken, err := client.VerifyToken(string(token))
if err != nil {
fmt.Printf("Something bad happened: %s\n\n", err)
return err
}
To create adapter refer go-sgx:
token, err := client.CollectToken(adapter, policyIds)
if err != nil {
return err
}
This library is distributed under the BSD-style license found in the LICENSE file.