pckcertselect

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Base SGX extensions OID
	SGXExtensionsOID = "1.2.840.113741.1.13.1"

	// TCB extensions (nested under base)
	SGXExtensionsPPID    = "1.2.840.113741.1.13.1.1"
	SGXExtensionsTCB     = "1.2.840.113741.1.13.1.2"
	SGXExtensionsPCEID   = "1.2.840.113741.1.13.1.3"
	SGXExtensionsFMSPC   = "1.2.840.113741.1.13.1.4"
	SGXExtensionsSGXType = "1.2.840.113741.1.13.1.5"

	// Individual TCB components (nested under .2)
	SGXExtensionsTCBComp01SVN = "1.2.840.113741.1.13.1.2.1"
	SGXExtensionsTCBComp02SVN = "1.2.840.113741.1.13.1.2.2"
	SGXExtensionsTCBComp03SVN = "1.2.840.113741.1.13.1.2.3"
	SGXExtensionsTCBComp04SVN = "1.2.840.113741.1.13.1.2.4"
	SGXExtensionsTCBComp05SVN = "1.2.840.113741.1.13.1.2.5"
	SGXExtensionsTCBComp06SVN = "1.2.840.113741.1.13.1.2.6"
	SGXExtensionsTCBComp07SVN = "1.2.840.113741.1.13.1.2.7"
	SGXExtensionsTCBComp08SVN = "1.2.840.113741.1.13.1.2.8"
	SGXExtensionsTCBComp09SVN = "1.2.840.113741.1.13.1.2.9"
	SGXExtensionsTCBComp10SVN = "1.2.840.113741.1.13.1.2.10"
	SGXExtensionsTCBComp11SVN = "1.2.840.113741.1.13.1.2.11"
	SGXExtensionsTCBComp12SVN = "1.2.840.113741.1.13.1.2.12"
	SGXExtensionsTCBComp13SVN = "1.2.840.113741.1.13.1.2.13"
	SGXExtensionsTCBComp14SVN = "1.2.840.113741.1.13.1.2.14"
	SGXExtensionsTCBComp15SVN = "1.2.840.113741.1.13.1.2.15"
	SGXExtensionsTCBComp16SVN = "1.2.840.113741.1.13.1.2.16"
	SGXExtensionsPCESVN       = "1.2.840.113741.1.13.1.2.17"
	SGXExtensionsCPUSVN       = "1.2.840.113741.1.13.1.2.18"
)

SGX extension OID constants

Variables

This section is empty.

Functions

func ParseSGXExtensions added in v0.1.1

func ParseSGXExtensions(extValue []byte) (fmspc []byte, ca string, err error)

ParseSGXExtensions parses the SGX extension to extract FMSPC and CA (processor vs platform) This is a public version for use by other packages

func SelectCertificate

func SelectCertificate(certs []string, cpuSVN, pceSVN, pceID string, tcbInfoJSON []byte) (int, error)

SelectCertificate selects the best matching PCK certificate based on TCB levels Returns the index of the selected certificate, or -1 if no match found Algorithm matches Intel's PCKCertSelection library

func SetVerbose

func SetVerbose(v bool)

SetVerbose enables or disables verbose logging

Types

type TCBInfo

type TCBInfo struct {
	TCBInfo struct {
		Version    int    `json:"version"`
		IssueDate  string `json:"issueDate"`
		NextUpdate string `json:"nextUpdate"`
		FMSPC      string `json:"fmspc"`
		PCEId      string `json:"pceId"`
		TCBType    int    `json:"tcbType"`
		TCBLevels  []struct {
			TCB struct {
				SGXTCBComp01SVN int `json:"sgxtcbcomp01svn"`
				SGXTCBComp02SVN int `json:"sgxtcbcomp02svn"`
				SGXTCBComp03SVN int `json:"sgxtcbcomp03svn"`
				SGXTCBComp04SVN int `json:"sgxtcbcomp04svn"`
				SGXTCBComp05SVN int `json:"sgxtcbcomp05svn"`
				SGXTCBComp06SVN int `json:"sgxtcbcomp06svn"`
				SGXTCBComp07SVN int `json:"sgxtcbcomp07svn"`
				SGXTCBComp08SVN int `json:"sgxtcbcomp08svn"`
				SGXTCBComp09SVN int `json:"sgxtcbcomp09svn"`
				SGXTCBComp10SVN int `json:"sgxtcbcomp10svn"`
				SGXTCBComp11SVN int `json:"sgxtcbcomp11svn"`
				SGXTCBComp12SVN int `json:"sgxtcbcomp12svn"`
				SGXTCBComp13SVN int `json:"sgxtcbcomp13svn"`
				SGXTCBComp14SVN int `json:"sgxtcbcomp14svn"`
				SGXTCBComp15SVN int `json:"sgxtcbcomp15svn"`
				SGXTCBComp16SVN int `json:"sgxtcbcomp16svn"`
				PCESVN          int `json:"pcesvn"`
			} `json:"tcb"`
			TCBDate   string `json:"tcbDate"`
			TCBStatus string `json:"tcbStatus"`
		} `json:"tcbLevels"`
	} `json:"tcbInfo"`
}

TCBInfo represents the TCB information from Intel PCS

Jump to

Keyboard shortcuts

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