Documentation ¶
Overview ¶
Package tpm contains types and functions for interacting with TPM structures.
Index ¶
Constants ¶
const ( TagAttestCertify = tpm2.TagAttestCertify GeneratedValue = 0xFF544347 )
re-exported constants
Variables ¶
var ( // ErrMissingHardwareDetails indicates that the TPM hardware details weren't found. ErrMissingHardwareDetails = errors.New("tpm: missing hardware details") // ErrInvalidHardwareDetails indicates that the TPM hardware details were invalid. ErrInvalidHardwareDetails = errors.New("tpm: invalid hardware details") )
var ErrInvalidVendorID = errors.New("invalid vendor ID")
ErrInvalidVendorID indicates that the vendor id is not valid.
var RegisteredVendors map[VendorID]Vendor
RegisteredVendors is the list of all known vendors.
Functions ¶
This section is empty.
Types ¶
type AttestationData ¶
type AttestationData = tpm2.AttestationData
AttestationData is TPM attested data, re-exported from the tpm2 package for a single import.
func UnmarshalAttestationData ¶
func UnmarshalAttestationData(raw []byte) (*AttestationData, error)
UnmarshalAttestationData unmarshals TPM attestation data.
type HardwareDetails ¶
HardwareDetails are the manufacturer details about the TPM hardware.
func GetHardwareDetailsFromCertificate ¶
func GetHardwareDetailsFromCertificate(certificate *x509.Certificate) (*HardwareDetails, error)
GetHardwareDetailsFromCertificate gets the hardware details from an x509 certificate's Subject Alternative Name according to 3.2.9 of: https://www.trustedcomputinggroup.org/wp-content/uploads/Credential_Profile_EK_V2.0_R14_published.pdf
func GetHardwareDetailsFromRDNSequence ¶
func GetHardwareDetailsFromRDNSequence(sequence pkix.RDNSequence) (*HardwareDetails, error)
GetHardwareDetailsFromRDNSequence gets the hardware details from Relative Distinguished Name sequence.
type Public ¶
Public is the TPM public key information, re-exported from the tpm2 package for a single import.
func UnmarshalPublic ¶
UnmarshalPublic unmarshals the public data.
type Vendor ¶
A Vendor is an approved TPM vendor as defined by the Trusted Computing Group at https://trustedcomputinggroup.org/resource/vendor-id-registry/.
type VendorID ¶
type VendorID [4]byte
A VendorID is a 16 bit identifier for a vendor.
func UnmarshalVendorID ¶
UnmarshalVendorID unmarshals a vendor id according to the TPMManufacturer format defined in 3.1.2 of https://www.trustedcomputinggroup.org/wp-content/uploads/Credential_Profile_EK_V2.0_R14_published.pdf:
The value of the TPMManufacturer attribute MUST be the ASCII representation of the hexadecimal value of the 4 byte vendor identifier defined in the TCG Vendor ID Registry[3]. Each byte is represented individually as a two digit unsigned hexadecimal number using the characters 0-9 and A-F. The result is concatenated together to form an 8 character name which is appended after the lower-case ASCII characters “id:”.