tpm

package
v0.0.0-...-60e628d Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package tpm contains types and functions for interacting with TPM structures.

Index

Constants

View Source
const (
	TagAttestCertify = tpm2.TagAttestCertify
	GeneratedValue   = 0xFF544347
)

re-exported constants

Variables

View Source
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")
)
View Source
var ErrInvalidVendorID = errors.New("invalid vendor ID")

ErrInvalidVendorID indicates that the vendor id is not valid.

View Source
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

type HardwareDetails struct {
	Manufacturer    Vendor
	PartNumber      string
	FirmwareVersion string
}

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

type Public = tpm2.Public

Public is the TPM public key information, re-exported from the tpm2 package for a single import.

func UnmarshalPublic

func UnmarshalPublic(raw []byte) (*Public, error)

UnmarshalPublic unmarshals the public data.

type Vendor

type Vendor struct {
	Name string
	ID   VendorID
}

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

func UnmarshalVendorID(value string) (VendorID, error)

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:”.

func (VendorID) String

func (id VendorID) String() string

String returns the VendorID as a string

Jump to

Keyboard shortcuts

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