Documentation
¶
Index ¶
- Constants
- type CertChain
- type DB
- func (d *DB) Close() error
- func (d *DB) DeleteRegisteredPlatform(qeID, pceID, cpuSVN, pceSVN string) error
- func (d *DB) GetAllCerts(qeID, pceID string) (map[string][]byte, error)
- func (d *DB) GetAllFMSPCs() []string
- func (d *DB) GetAllPlatforms() ([]*Platform, error)
- func (d *DB) GetAllRegisteredPlatforms() ([]*RegisteredPlatform, error)
- func (d *DB) GetAppraisalPolicy(fmspc string) ([]byte, error)
- func (d *DB) GetCRL(ca string) ([]byte, error)
- func (d *DB) GetCRLByURI(uri string) ([]byte, error)
- func (d *DB) GetCert(qeID, pceID, tcbm string) ([]byte, error)
- func (d *DB) GetCertChain(ca string) (*CertChain, error)
- func (d *DB) GetIdentity(id, version, updateType string) ([]byte, error)
- func (d *DB) GetPlatform(qeID, pceID string) (*Platform, error)
- func (d *DB) GetPlatformTCB(qeID, pceID, cpuSVN, pceSVN string) (string, error)
- func (d *DB) GetPlatformsByFMSPC(fmspcs []string) ([]*Platform, error)
- func (d *DB) GetRegisteredPlatform(qeID, pceID, cpuSVN, pceSVN string) (*RegisteredPlatform, error)
- func (d *DB) GetRootCACRL(rootca string) ([]byte, error)
- func (d *DB) GetTCBInfo(prodType, fmspc, version, updateType string) ([]byte, error)
- func (d *DB) PutAppraisalPolicy(fmspc string, policy []byte) error
- func (d *DB) PutCRL(ca string, crl []byte) error
- func (d *DB) PutCRLByURI(uri string, crl []byte) error
- func (d *DB) PutCert(qeID, pceID, tcbm string, cert []byte) error
- func (d *DB) PutCertChain(ca string, chain *CertChain) error
- func (d *DB) PutIdentity(id, version, updateType string, identity []byte) error
- func (d *DB) PutPlatform(qeID, pceID string, platform *Platform) error
- func (d *DB) PutPlatformTCB(qeID, pceID, cpuSVN, pceSVN, tcbm string) error
- func (d *DB) PutRegisteredPlatform(qeID, pceID, cpuSVN, pceSVN string, regPlatform *RegisteredPlatform) error
- func (d *DB) PutRootCACRL(rootca string, crl []byte) error
- func (d *DB) PutTCBInfo(prodType, fmspc, version, updateType string, tcbInfo []byte) error
- type Platform
- type RegisteredPlatform
Constants ¶
const ( ProdTypeSGX = "sgx" ProdTypeTDX = "tdx" )
Constants for product types
const ( UpdateTypeStandard = "standard" UpdateTypeEarly = "early" )
Constants for update types
const ( IdentityQE = "1" // QE (Quoting Enclave) IdentityQVE = "2" // QVE (Quote Verification Enclave) IdentityTDQE = "3" // TDQE (TD Quoting Enclave) )
Constants for enclave identity IDs
const ( CAProcessor = "processor" CAPlatform = "platform" )
Constants for CA types
const ( PlatformRegNew = 0 PlatformRegNotAvailable = 1 PlatformRegDeleted = 9 )
Constants for registration states
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertChain ¶
type CertChain struct {
CA string `json:"ca"`
RootCert string `json:"root_cert"`
IntmdCert string `json:"intmd_cert,omitempty"`
}
CertChain represents a certificate chain
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps PebbleDB for caching SGX attestation collaterals
func (*DB) DeleteRegisteredPlatform ¶
DeleteRegisteredPlatform removes a registered platform from queue
func (*DB) GetAllCerts ¶
GetAllCerts retrieves all certificates for a platform
func (*DB) GetAllFMSPCs ¶
GetAllFMSPCs returns all unique FMSPCs in the database
func (*DB) GetAllPlatforms ¶
GetAllPlatforms returns all platforms in the database
func (*DB) GetAllRegisteredPlatforms ¶
func (d *DB) GetAllRegisteredPlatforms() ([]*RegisteredPlatform, error)
GetAllRegisteredPlatforms returns all registered platforms in queue
func (*DB) GetAppraisalPolicy ¶
GetAppraisalPolicy retrieves appraisal policy for a specific FMSPC
func (*DB) GetCRLByURI ¶
GetCRLByURI retrieves CRL by URI
func (*DB) GetCertChain ¶
GetCertChain retrieves certificate chain for a CA
func (*DB) GetIdentity ¶
GetIdentity retrieves enclave identity
func (*DB) GetPlatform ¶
GetPlatform retrieves platform information
func (*DB) GetPlatformTCB ¶
GetPlatformTCB retrieves TCBm for a specific platform TCB level
func (*DB) GetPlatformsByFMSPC ¶
GetPlatformsByFMSPC returns platforms with specific FMSPCs
func (*DB) GetRegisteredPlatform ¶
func (d *DB) GetRegisteredPlatform(qeID, pceID, cpuSVN, pceSVN string) (*RegisteredPlatform, error)
GetRegisteredPlatform retrieves a registered platform from queue
func (*DB) GetRootCACRL ¶
GetRootCACRL retrieves root CA CRL
func (*DB) GetTCBInfo ¶
GetTCBInfo retrieves TCB information
func (*DB) PutAppraisalPolicy ¶
PutAppraisalPolicy stores an appraisal policy for a specific FMSPC
func (*DB) PutCRLByURI ¶
PutCRLByURI stores CRL by URI
func (*DB) PutCertChain ¶
PutCertChain stores certificate chain for a CA
func (*DB) PutIdentity ¶
PutIdentity stores enclave identity
func (*DB) PutPlatform ¶
PutPlatform stores platform information
func (*DB) PutPlatformTCB ¶
PutPlatformTCB stores TCBm for a specific platform TCB level
func (*DB) PutRegisteredPlatform ¶
func (d *DB) PutRegisteredPlatform(qeID, pceID, cpuSVN, pceSVN string, regPlatform *RegisteredPlatform) error
PutRegisteredPlatform stores a registered platform in queue
func (*DB) PutRootCACRL ¶
PutRootCACRL stores root CA CRL
type Platform ¶
type Platform struct {
QEID string `json:"qe_id"`
PCEID string `json:"pce_id"`
PlatformManifest string `json:"platform_manifest,omitempty"`
EncPPID string `json:"enc_ppid,omitempty"`
FMSPC string `json:"fmspc"`
CA string `json:"ca"` // "processor" or "platform"
}
Platform represents a registered SGX platform
type RegisteredPlatform ¶
type RegisteredPlatform struct {
QEID string `json:"qe_id"`
PCEID string `json:"pce_id"`
CPUSVN string `json:"cpu_svn"`
PCESVN string `json:"pce_svn"`
EncPPID string `json:"enc_ppid,omitempty"`
PlatformManifest string `json:"platform_manifest,omitempty"`
State int `json:"state"` // 0 = new, 1 = not available, 9 = deleted
}
RegisteredPlatform represents a platform in the registration queue (OFFLINE mode)