client

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

* Copyright (c) 2023 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

* Copyright (c) 2022 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

* Copyright (c) 2022 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

* Copyright (c) 2022 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

* Copyright (c) 2022 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

* Copyright (c) 2022 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

* Copyright (c) 2022 Intel Corporation * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause

Index

Constants

View Source
const (
	AtsCertChainMaxLen = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AmberClient

type AmberClient interface {
	GetAmberCertificates() ([]byte, error)
	GetNonce() (*VerifierNonce, error)
	GetToken(verifierNonce *VerifierNonce, policyIds []uuid.UUID, evidence *Evidence) (string, error)
	CollectToken(adapter EvidenceAdapter, policyIds []uuid.UUID) (string, error)
	VerifyToken(string) (*jwt.Token, error)
}

AmberClient is an interface which exposes methods for calling Amber REST APIs

func New

func New(cfg *Config) (AmberClient, error)

New returns a new Amber API client instance

type AttestationTokenResponse

type AttestationTokenResponse struct {
	Token string `json:"token"`
}

type Config

type Config struct {
	BaseUrl string
	TlsCfg  *tls.Config
	ApiUrl  string
	ApiKey  string
	// contains filtered or unexported fields
}

Config holds the Amber configuration for Client

type Evidence

type Evidence struct {
	Type     uint32
	Evidence []byte
	UserData []byte
	EventLog []byte
}

Evidence is used to store Quote to be sent for Attestation

type EvidenceAdapter

type EvidenceAdapter interface {
	CollectEvidence(nonce []byte) (*Evidence, error)
}

EvidenceAdapter is an interface which exposes methods for collecting Quote using Adapter

type VerifierNonce

type VerifierNonce struct {
	Val       []byte `json:"val"`
	Iat       []byte `json:"iat"`
	Signature []byte `json:"signature"`
}

VerifierNonce holds the signed nonce issued from Amber

Jump to

Keyboard shortcuts

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