diff --git a/tpm.go b/tpm.go index 4c642eb..4833112 100644 --- a/tpm.go +++ b/tpm.go @@ -60,7 +60,7 @@ func GetPubHash(opts ...Option) (string, error) { return "", fmt.Errorf("getting EK: %w", err) } - hash, err := getPubHash(ek) + hash, err := DecodePubHash(ek) if err != nil { return "", fmt.Errorf("hashing EK: %w", err) } diff --git a/tpm_attestor.go b/tpm_attestor.go index 957c601..0c50c14 100644 --- a/tpm_attestor.go +++ b/tpm_attestor.go @@ -43,7 +43,8 @@ type ChallengeResponse struct { Secret []byte } -func getPubHash(ek *attest.EK) (string, error) { +// DecodePubHash returns the public key from an attestation EK +func DecodePubHash(ek *attest.EK) (string, error) { data, err := pubBytes(ek) if err != nil { return "", err