internal

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: Apache-2.0, BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package internal contains private helper functions needed in client and server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSubset added in v0.3.0

func CheckSubset(subset, superset *pb.PCRs) error

CheckSubset verifies if the pcrs PCRs are a valid "subset" of the provided "superset" of PCRs. The PCR values must match (if present), and all PCRs must be present in the superset. This function will return an error containing the first missing or mismatched PCR number.

func FormatPCRs added in v0.3.0

func FormatPCRs(w io.Writer, p *pb.PCRs) error

FormatPCRs writes a multiline representation of the PCR values to w.

func GetCertificateChain added in v0.4.6

func GetCertificateChain(cert *x509.Certificate, client *http.Client) ([][]byte, error)

GetCertificateChain constructs the certificate chain for the key's certificate. If an error is encountered in the process, return what has been constructed so far.

func GetSigningHashAlg added in v0.3.0

func GetSigningHashAlg(pubArea tpm2.Public) (tpm2.Algorithm, error)

GetSigningHashAlg returns the hash algorithm used for a signing key. Returns an error if an algorithm isn't supported, or the key is not a signing key.

func PCRDigest added in v0.3.0

func PCRDigest(p *pb.PCRs, hashAlg crypto.Hash) []byte

PCRDigest computes the digest of the Pcrs. Note that the digest hash algorithm may differ from the PCRs' hash (which denotes the PCR bank).

func PCRSelection added in v0.3.0

func PCRSelection(p *pb.PCRs) tpm2.PCRSelection

PCRSelection returns the corresponding tpm2.PCRSelection for the PCR data.

func PCRSessionAuth added in v0.3.0

func PCRSessionAuth(p *pb.PCRs, hashAlg crypto.Hash) []byte

PCRSessionAuth calculates the authorization value for the given PCRs.

func PubKeysEqual added in v0.3.4

func PubKeysEqual(k1 crypto.PublicKey, k2 crypto.PublicKey) bool

PubKeysEqual returns whether the two public keys are equal.

func SamePCRSelection added in v0.3.0

func SamePCRSelection(p *pb.PCRs, sel tpm2.PCRSelection) bool

SamePCRSelection checks if the Pcrs has the same PCRSelection as the provided given tpm2.PCRSelection (including the hash algorithm).

Types

This section is empty.

Directories

Path Synopsis
Package test provides helper methods for testing.
Package test provides helper methods for testing.

Jump to

Keyboard shortcuts

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