sgx

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0, MIT Imports: 7 Imported by: 1

Documentation

Overview

Package sgx provides Intel SGX specific functionality.

Index

Constants

View Source
const (
	SGXModeEnvKey         = "SGX_MODE"
	SGXModeHwType         = "HW"
	SGXModeSimType        = "SIM"
	SGXCredentialsPathKey = "SGX_CREDENTIALS_PATH"
)

Variables

This section is empty.

Functions

func ReadSPID

func ReadSPID(sgxCredentialsPath string) (string, error)

ReadSPID reads the SPID from a credentials path and returns it as string.

func ReadSPIDType

func ReadSPIDType(sgxCredentialsPath string) (string, error)

ReadSPIDType reads the SPID type from a credentials path and returns it as string.

func ReadSigRL

func ReadSigRL(sgxCredentialsPath string) (string, error)

ReadSigRL reads the Signature Revocation List from a credentials path and returns it as string.

Types

type AttestationParams

type AttestationParams struct {
	AttestationType string `json:"attestation_type"`
	HexSpid         string `json:"hex_spid"`
	SigRL           string `json:"sig_rl"`
}

AttestationParams holds additional attestation information that is required to perform LifecycleInitEnclave.

func CreateAttestationParamsFromCredentialsPath

func CreateAttestationParamsFromCredentialsPath(sgxCredentialsPath string) (*AttestationParams, error)

CreateAttestationParamsFromCredentialsPath reads attestation information from a given path and returns an SGXAttestationParams object.

func CreateAttestationParamsFromEnvironment

func CreateAttestationParamsFromEnvironment() (*AttestationParams, error)

CreateAttestationParamsFromEnvironment reads attestation information from environment variables and returns an SGXAttestationParams object. This methods requires `SGX_MODE` and `SGX_CREDENTIALS_PATH` to be set.

func (*AttestationParams) ToBase64EncodedJSON

func (p *AttestationParams) ToBase64EncodedJSON() ([]byte, error)

ToBase64EncodedJSON returns the SGXAttestationParams object as serialized JSON with Base64 encoding.

func (*AttestationParams) Validate

func (p *AttestationParams) Validate() error

Validate checks that the attestation information are correct.

Jump to

Keyboard shortcuts

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