pccs

package
v0.0.0-...-cbf774f Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CA_ROOT uint8 = iota
	CA_PROCESSOR
	CA_PLATFORM
	CA_SIGNING
)

Constants for CA types

View Source
const (
	ENCLAVE_ID_QE uint8 = iota
	ENCLAVE_ID_QVE
	ENCLAVE_ID_TDQE
)

Constants for Enclave ID types

Variables

This section is empty.

Functions

This section is empty.

Types

type CertCrl

type CertCrl struct {
	Cert []byte
	Crl  []byte
}

CertCrl holds certificate and CRL data

type ChainConfig

type ChainConfig struct {
	AutomataPcsDao             common.Address `json:"automata_pcs_dao"`
	AutomataFmspcTcbDao        common.Address `json:"automata_fmspc_tcb_dao"`
	AutomataEnclaveIdentityDao common.Address `json:"automata_enclave_identity_dao"`
}

ChainConfig holds the addresses of the smart contracts

type Client

type Client struct {
	// contains filtered or unexported fields
}

Server struct holds the Ethereum client and contract instances

func NewClient

func NewClient(client *ethclient.Client, chain *ChainConfig) (*Client, error)

NewClient initializes a new Server instance

func (*Client) GetCertByID

func (p *Client) GetCertByID(ctx context.Context, ca uint8) (*CertCrl, error)

GetCertByID retrieves a certificate by its CA ID

func (*Client) GetEnclaveID

func (p *Client) GetEnclaveID(ctx context.Context, enclaveId uint8, version uint32) (*EnclaveIdentityInfo, error)

GetEnclaveID retrieves enclave identity information by ID and version

func (*Client) GetTcbInfo

func (p *Client) GetTcbInfo(ctx context.Context, tcbType uint8, fmspc string, tcbVersion uint32) (*TcbInfo, error)

GetTcbInfo retrieves TCB information by type, FMSPC, and version

type EnclaveIdentityInfo

type EnclaveIdentityInfo struct {
	Identity  json.RawMessage `json:"enclaveIdentity"`
	Signature string          `json:"signature"`
}

EnclaveIdentityInfo holds enclave identity information and its signature

func (*EnclaveIdentityInfo) Encode

func (e *EnclaveIdentityInfo) Encode() []byte

Encode serializes EnclaveIdentityInfo to JSON

type TcbInfo

type TcbInfo struct {
	TcbInfo   json.RawMessage `json:"tcbInfo"`
	Signature string          `json:"signature"`
}

TcbInfo holds TCB information and its signature

func (*TcbInfo) Encode

func (t *TcbInfo) Encode() []byte

Encode serializes TcbInfo to JSON

Jump to

Keyboard shortcuts

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