Documentation
¶
Overview ¶
Package internal contains private helper functions needed in client and server
Index ¶
- func CheckSubset(subset, superset *pb.PCRs) error
- func FormatPCRs(w io.Writer, p *pb.PCRs) error
- func GetCertificateChain(cert *x509.Certificate, client *http.Client) ([][]byte, error)
- func GetSigningHashAlg(pubArea tpm2.Public) (tpm2.Algorithm, error)
- func PCRDigest(p *pb.PCRs, hashAlg crypto.Hash) []byte
- func PCRSelection(p *pb.PCRs) tpm2.PCRSelection
- func PCRSessionAuth(p *pb.PCRs, hashAlg crypto.Hash) []byte
- func PubKeysEqual(k1 crypto.PublicKey, k2 crypto.PublicKey) bool
- func SamePCRSelection(p *pb.PCRs, sel tpm2.PCRSelection) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSubset ¶ added in v0.3.0
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
FormatPCRs writes a multiline representation of the PCR values to w.
func GetCertificateChain ¶ added in v0.4.6
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
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
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
PCRSessionAuth calculates the authorization value for the given PCRs.
func PubKeysEqual ¶ added in v0.3.4
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.