enclave

package
v0.1.40 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enclave

type Enclave struct {
	crpt.Cipher
}

Enclave is secure enclave.

var (
	Store *Enclave // Store is the default secure enclave created by pkg init.
)

func New

func New(hexKey string) *Enclave

New creates a new Enclave.

func (Enclave) IsKeyHandle

func (e Enclave) IsKeyHandle(credID []byte) (ok bool, kh KeyHandle)

IsKeyHandle tells if given byte slice really is key handle from the current Enclave.

func (Enclave) NewKeyHandle

func (e Enclave) NewKeyHandle() (_ KeyHandle, err error)

NewKeyHandle creates a new key handle for the Enclave. The Enclave is stateless, which means that only the master key is needed. The master key is stored to every key handle to maintain statelessness.

type KeyHandle

type KeyHandle interface {
	ID() []byte
	CBORPublicKey() ([]byte, error)
	Sign(d []byte) ([]byte, error)

	Verify(data, sig []byte) (ok bool) // Mainly testing
}

Jump to

Keyboard shortcuts

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