tpm2 package - github.com/google/go-tpm/tpm2 - Go Packages (original) (raw)

Package tpm2 provides 1:1 mapping to TPM 2.0 APIs.

Package tpm2 defines all the TPM 2.0 structures together to avoid import cycles

Package tpm2 contains TPM 2.0 commands and structures.

View Source

const ( TPMAlgSHA = TPMAlgSHA1 TPMCCHMAC = TPMCCMAC TPMCCHMACStart = TPMCCMACStart TPMHTLoadedSession = TPMHTHMACSession TPMHTSavedSession = TPMHTPolicySession )

Hash algorithm IDs and command codes that got re-used.

View Source

const (

EncryptIn parameterEncryptiontpm2ion = 1 + [iota](/builtin#iota)

EncryptOut

EncryptInOut

)

View Source

var (

RSASRKTemplate = [TPMTPublic](#TPMTPublic){
    Type:    [TPMAlgRSA](#TPMAlgRSA),
    NameAlg: [TPMAlgSHA256](#TPMAlgSHA256),
    ObjectAttributes: [TPMAObject](#TPMAObject){
        FixedTPM:             [true](/builtin#true),
        STClear:              [false](/builtin#false),
        FixedParent:          [true](/builtin#true),
        SensitiveDataOrigin:  [true](/builtin#true),
        UserWithAuth:         [true](/builtin#true),
        AdminWithPolicy:      [false](/builtin#false),
        NoDA:                 [true](/builtin#true),
        EncryptedDuplication: [false](/builtin#false),
        Restricted:           [true](/builtin#true),
        Decrypt:              [true](/builtin#true),
        SignEncrypt:          [false](/builtin#false),
    },
    Parameters: [NewTPMUPublicParms](#NewTPMUPublicParms)(
        [TPMAlgRSA](#TPMAlgRSA),
        &[TPMSRSAParms](#TPMSRSAParms){
            Symmetric: [TPMTSymDefObject](#TPMTSymDefObject){
                Algorithm: [TPMAlgAES](#TPMAlgAES),
                KeyBits: [NewTPMUSymKeyBits](#NewTPMUSymKeyBits)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMKeyBits](#TPMKeyBits)(128),
                ),
                Mode: [NewTPMUSymMode](#NewTPMUSymMode)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMAlgCFB](#TPMAlgCFB),
                ),
            },
            KeyBits: 2048,
        },
    ),
    Unique: [NewTPMUPublicID](#NewTPMUPublicID)(
        [TPMAlgRSA](#TPMAlgRSA),
        &[TPM2BPublicKeyRSA](#TPM2BPublicKeyRSA){
            Buffer: [make](/builtin#make)([][byte](/builtin#byte), 256),
        },
    ),
}

RSAEKTemplate = [TPMTPublic](#TPMTPublic){
    Type:    [TPMAlgRSA](#TPMAlgRSA),
    NameAlg: [TPMAlgSHA256](#TPMAlgSHA256),
    ObjectAttributes: [TPMAObject](#TPMAObject){
        FixedTPM:             [true](/builtin#true),
        STClear:              [false](/builtin#false),
        FixedParent:          [true](/builtin#true),
        SensitiveDataOrigin:  [true](/builtin#true),
        UserWithAuth:         [false](/builtin#false),
        AdminWithPolicy:      [true](/builtin#true),
        NoDA:                 [false](/builtin#false),
        EncryptedDuplication: [false](/builtin#false),
        Restricted:           [true](/builtin#true),
        Decrypt:              [true](/builtin#true),
        SignEncrypt:          [false](/builtin#false),
    },
    AuthPolicy: [TPM2BDigest](#TPM2BDigest){
        Buffer: [][byte](/builtin#byte){

            0x83, 0x71, 0x97, 0x67, 0x44, 0x84, 0xB3, 0xF8,
            0x1A, 0x90, 0xCC, 0x8D, 0x46, 0xA5, 0xD7, 0x24,
            0xFD, 0x52, 0xD7, 0x6E, 0x06, 0x52, 0x0B, 0x64,
            0xF2, 0xA1, 0xDA, 0x1B, 0x33, 0x14, 0x69, 0xAA,
        },
    },
    Parameters: [NewTPMUPublicParms](#NewTPMUPublicParms)(
        [TPMAlgRSA](#TPMAlgRSA),
        &[TPMSRSAParms](#TPMSRSAParms){
            Symmetric: [TPMTSymDefObject](#TPMTSymDefObject){
                Algorithm: [TPMAlgAES](#TPMAlgAES),
                KeyBits: [NewTPMUSymKeyBits](#NewTPMUSymKeyBits)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMKeyBits](#TPMKeyBits)(128),
                ),
                Mode: [NewTPMUSymMode](#NewTPMUSymMode)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMAlgCFB](#TPMAlgCFB),
                ),
            },
            KeyBits: 2048,
        },
    ),
    Unique: [NewTPMUPublicID](#NewTPMUPublicID)(
        [TPMAlgRSA](#TPMAlgRSA),
        &[TPM2BPublicKeyRSA](#TPM2BPublicKeyRSA){
            Buffer: [make](/builtin#make)([][byte](/builtin#byte), 256),
        },
    ),
}


ECCSRKTemplate = [TPMTPublic](#TPMTPublic){
    Type:    [TPMAlgECC](#TPMAlgECC),
    NameAlg: [TPMAlgSHA256](#TPMAlgSHA256),
    ObjectAttributes: [TPMAObject](#TPMAObject){
        FixedTPM:             [true](/builtin#true),
        STClear:              [false](/builtin#false),
        FixedParent:          [true](/builtin#true),
        SensitiveDataOrigin:  [true](/builtin#true),
        UserWithAuth:         [true](/builtin#true),
        AdminWithPolicy:      [false](/builtin#false),
        NoDA:                 [true](/builtin#true),
        EncryptedDuplication: [false](/builtin#false),
        Restricted:           [true](/builtin#true),
        Decrypt:              [true](/builtin#true),
        SignEncrypt:          [false](/builtin#false),
    },
    Parameters: [NewTPMUPublicParms](#NewTPMUPublicParms)(
        [TPMAlgECC](#TPMAlgECC),
        &[TPMSECCParms](#TPMSECCParms){
            Symmetric: [TPMTSymDefObject](#TPMTSymDefObject){
                Algorithm: [TPMAlgAES](#TPMAlgAES),
                KeyBits: [NewTPMUSymKeyBits](#NewTPMUSymKeyBits)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMKeyBits](#TPMKeyBits)(128),
                ),
                Mode: [NewTPMUSymMode](#NewTPMUSymMode)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMAlgCFB](#TPMAlgCFB),
                ),
            },
            CurveID: [TPMECCNistP256](#TPMECCNistP256),
        },
    ),
    Unique: [NewTPMUPublicID](#NewTPMUPublicID)(
        [TPMAlgECC](#TPMAlgECC),
        &[TPMSECCPoint](#TPMSECCPoint){
            X: [TPM2BECCParameter](#TPM2BECCParameter){
                Buffer: [make](/builtin#make)([][byte](/builtin#byte), 32),
            },
            Y: [TPM2BECCParameter](#TPM2BECCParameter){
                Buffer: [make](/builtin#make)([][byte](/builtin#byte), 32),
            },
        },
    ),
}


ECCEKTemplate = [TPMTPublic](#TPMTPublic){
    Type:    [TPMAlgECC](#TPMAlgECC),
    NameAlg: [TPMAlgSHA256](#TPMAlgSHA256),
    ObjectAttributes: [TPMAObject](#TPMAObject){
        FixedTPM:             [true](/builtin#true),
        STClear:              [false](/builtin#false),
        FixedParent:          [true](/builtin#true),
        SensitiveDataOrigin:  [true](/builtin#true),
        UserWithAuth:         [false](/builtin#false),
        AdminWithPolicy:      [true](/builtin#true),
        NoDA:                 [false](/builtin#false),
        EncryptedDuplication: [false](/builtin#false),
        Restricted:           [true](/builtin#true),
        Decrypt:              [true](/builtin#true),
        SignEncrypt:          [false](/builtin#false),
    },
    AuthPolicy: [TPM2BDigest](#TPM2BDigest){
        Buffer: [][byte](/builtin#byte){

            0x83, 0x71, 0x97, 0x67, 0x44, 0x84, 0xB3, 0xF8,
            0x1A, 0x90, 0xCC, 0x8D, 0x46, 0xA5, 0xD7, 0x24,
            0xFD, 0x52, 0xD7, 0x6E, 0x06, 0x52, 0x0B, 0x64,
            0xF2, 0xA1, 0xDA, 0x1B, 0x33, 0x14, 0x69, 0xAA,
        },
    },
    Parameters: [NewTPMUPublicParms](#NewTPMUPublicParms)(
        [TPMAlgECC](#TPMAlgECC),
        &[TPMSECCParms](#TPMSECCParms){
            Symmetric: [TPMTSymDefObject](#TPMTSymDefObject){
                Algorithm: [TPMAlgAES](#TPMAlgAES),
                KeyBits: [NewTPMUSymKeyBits](#NewTPMUSymKeyBits)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMKeyBits](#TPMKeyBits)(128),
                ),
                Mode: [NewTPMUSymMode](#NewTPMUSymMode)(
                    [TPMAlgAES](#TPMAlgAES),
                    [TPMAlgCFB](#TPMAlgCFB),
                ),
            },
            CurveID: [TPMECCNistP256](#TPMECCNistP256),
        },
    ),
    Unique: [NewTPMUPublicID](#NewTPMUPublicID)(
        [TPMAlgECC](#TPMAlgECC),
        &[TPMSECCPoint](#TPMSECCPoint){
            X: [TPM2BECCParameter](#TPM2BECCParameter){
                Buffer: [make](/builtin#make)([][byte](/builtin#byte), 32),
            },
            Y: [TPM2BECCParameter](#TPM2BECCParameter){
                Buffer: [make](/builtin#make)([][byte](/builtin#byte), 32),
            },
        },
    ),
}

)

func AuditCommand added in v0.9.0

func AuditCommand[C Command[R, *R], R any](a *CommandAudit, cmd C, rsp *R) error

AuditCommand extends the audit digest with the given command and response. Go Generics do not allow type parameters on methods, otherwise this would be a method on CommandAudit. See https://github.com/golang/go/issues/49085 for more information.

KDFa implements TPM 2.0's default key derivation function, as defined in section 11.4.9.2 of the TPM revision 2 specification part 1. See: https://trustedcomputinggroup.org/resource/tpm-library-specification/The key & label parameters must not be zero length. The label parameter is a non-null-terminated string. The contextU & contextV parameters are optional.

KDFe implements TPM 2.0's ECDH key derivation function, as defined in section 11.4.9.3 of the TPM revision 2 specification part 1. See: https://trustedcomputinggroup.org/resource/tpm-library-specification/The z parameter is the x coordinate of one party's private ECC key multiplied by the other party's public ECC point. The use parameter is a non-null-terminated string. The partyUInfo and partyVInfo are the x coordinates of the initiator's and the responder's ECC points, respectively.

Marshal will serialize the given values, returning them as a byte slice.

func PrimaryHandleName added in v0.9.0

func PrimaryHandleName(h TPMHandle) []byte

PrimaryHandleName returns the TPM Name of a primary handle.

RSAPub converts a TPM RSA public key into one recognized by the rsa package.

func Unmarshal[T Marshallable, P interface { *T Unmarshallable }](data []byte) (*T, error)

Unmarshal unmarshals the given type from the byte array. Returns an error if the buffer does not contain enough data to satisfy the types, or if the types are not unmarshallable.

type ActivateCredential struct {

ActivateHandle handle `gotpm:"handle,auth"`

KeyHandle handle `gotpm:"handle,auth"`

CredentialBlob [TPM2BIDObject](#TPM2BIDObject)

Secret [TPM2BEncryptedSecret](#TPM2BEncryptedSecret)

}

ActivateCredential is the input to TPM2_ActivateCredential. See definition in Part 3, Commands, section 12.5.

func (ActivateCredential) Command added in v0.9.0

func (ActivateCredential) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ActivateCredentialResponse struct {

CertInfo [TPM2BDigest](#TPM2BDigest)

}

ActivateCredentialResponse is the response from TPM2_ActivateCredential.

type AsymSchemeContents added in v0.9.0

AsymSchemeContents is a type constraint representing the possible contents of TPMUAsymScheme.

type AttestContents added in v0.9.0

AttestContents is a type constraint representing the possible contents of TPMUAttest.

type AuthHandle added in v0.9.0

type AuthHandle struct { Handle TPMHandle Name TPM2BName Auth Session }

AuthHandle allows the caller to add an authorization session onto a handle.

func (AuthHandle) HandleValue added in v0.9.0

HandleValue implements the handle interface.

func (AuthHandle) KnownName added in v0.9.0

func (h AuthHandle) KnownName() *TPM2BName

KnownName implements the handle interface. If Name is not provided (i.e., only Auth), then rely on the underlying TPMHandle.

type AuthOption func(*sessionOptions)

AuthOption is an option for setting up an auth session variadically.

func AESEncryption(keySize TPMKeyBits, dir parameterEncryptiontpm2ion) AuthOption

AESEncryption uses the session to encrypt the first parameter sent to/from the TPM. Note that only commands whose first command/response parameter is a 2B can support session encryption.

Audit uses the session to compute extra HMACs. An Audit session can be used with GetSessionAuditDigest to obtain attestation over a sequence of commands.

func AuditExclusive() AuthOption

AuditExclusive is like an audit session, but even more powerful. This allows an audit session to additionally indicate that no other auditable commands were executed other than the ones described by the audit hash.

Auth uses the session to prove knowledge of the object's auth value.

func Bound(handle TPMIDHEntity, name TPM2BName, auth []byte) AuthOption

Bound specifies that this session's session key should depend on the auth value of the given object.

func Password(auth []byte) AuthOption

Password is a policy-session-only option that specifies to provide the object's auth value in place of the authorization HMAC when authorizing. For HMAC sessions, has the same effect as using Auth. Deprecated: This is not recommended and is only provided for completeness; use Auth instead.

func Salted(handle TPMIDHObject, pub TPMTPublic) AuthOption

Salted specifies that this session's session key should depend on an encrypted seed value using the given public key. 'handle' must refer to a loaded RSA or ECC key.

Trial indicates that the policy session should be in trial-mode. This allows using the TPM to calculate policy hashes. This option has no effect on non-Policy sessions.

type BitGetter interface { Bitfield

GetReservedBit(pos [int](/builtin#int)) [bool](/builtin#bool)

}

BitGetter represents a TPM bitfield (i.e., TPMA_*) type that can be read.

type BitSetter interface { Bitfield

SetReservedBit(pos [int](/builtin#int), val [bool](/builtin#bool))

}

BitSetter represents a TPM bitfield (i.e., TPMA_*) type that can be written.

type Bitfield interface {

Length() [int](/builtin#int)

}

Bitfield represents a TPM bitfield (i.e., TPMA_*) type.

type CapabilitiesContents added in v0.9.0

type CapabilitiesContents interface { Marshallable *TPMLAlgProperty | *TPMLHandle | *TPMLCCA | *TPMLCC | *TPMLPCRSelection | *TPMLTaggedTPMProperty | *TPMLTaggedPCRProperty | *TPMLECCCurve | *TPMLTaggedPolicy | *TPMLACTData }

CapabilitiesContents is a type constraint representing the possible contents of TPMUCapabilities.

type Certify struct {

ObjectHandle handle `gotpm:"handle,auth"`

SignHandle handle `gotpm:"handle,auth"`

QualifyingData [TPM2BData](#TPM2BData)

InScheme [TPMTSigScheme](#TPMTSigScheme)

}

Certify is the input to TPM2_Certify. See definition in Part 3, Commands, section 18.2.

func (Certify) Command added in v0.9.0

func (Certify) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type CertifyCreation struct {

SignHandle handle `gotpm:"handle,auth"`

ObjectHandle handle `gotpm:"handle"`

QualifyingData [TPM2BData](#TPM2BData)

CreationHash [TPM2BDigest](#TPM2BDigest)

InScheme [TPMTSigScheme](#TPMTSigScheme)

CreationTicket [TPMTTKCreation](#TPMTTKCreation)

}

CertifyCreation is the input to TPM2_CertifyCreation. See definition in Part 3, Commands, section 18.3.

func (CertifyCreation) Command added in v0.9.0

func (CertifyCreation) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type CertifyCreationResponse struct {

CertifyInfo [TPM2BAttest](#TPM2BAttest)

Signature [TPMTSignature](#TPMTSignature)

}

CertifyCreationResponse is the response from TPM2_CertifyCreation.

type CertifyResponse struct {

CertifyInfo [TPM2BAttest](#TPM2BAttest)

Signature [TPMTSignature](#TPMTSignature)

}

CertifyResponse is the response from TPM2_Certify.

type Clear struct {

AuthHandle handle `gotpm:"handle,auth"`

}

Clear is the input to TPM2_Clear. See definition in Part 3, Commands, section 24.6

func (Clear) Command added in v0.9.0

func (Clear) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ClearResponse struct{}

ClearResponse is the response from TPM2_Clear.

type Command added in v0.9.0

Command is an interface for any TPM command, parameterized by its response type.

type CommandAudit added in v0.9.0

type CommandAudit struct {

}

CommandAudit represents an audit session for attesting the execution of a series of commands in the TPM. It is useful for both command and session auditing.

NewAudit initializes a new CommandAudit with the specified hash algorithm.

func (*CommandAudit) Digest added in v0.9.0

func (a *CommandAudit) Digest() []byte

Digest returns the current digest of the audit.

type Commit struct {

SignHandle handle `gotpm:"handle,auth"`

P1 [TPM2BECCPoint](#TPM2BECCPoint)

S2 [TPM2BSensitiveData](#TPM2BSensitiveData)

Y2 [TPM2BECCParameter](#TPM2BECCParameter)

}

Commit is the input to TPM2_Commit. See definition in Part 3, Commands, section 19.2.

func (Commit) Command added in v0.9.0

func (Commit) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type CommitResponse struct {

K [TPM2BECCPoint](#TPM2BECCPoint)

L [TPM2BECCPoint](#TPM2BECCPoint)

E [TPM2BECCPoint](#TPM2BECCPoint)

Counter [uint16](/builtin#uint16)

}

CommitResponse is the response from TPM2_Commit.

type ContextLoad struct {

Context [TPMSContext](#TPMSContext)

}

ContextLoad is the input to TPM2_ContextLoad. See definition in Part 3, Commands, section 28.3

func (ContextLoad) Command added in v0.9.0

func (ContextLoad) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ContextLoadResponse struct {

LoadedHandle [TPMIDHContext](#TPMIDHContext)

}

ContextLoadResponse is the response from TPM2_ContextLoad.

type ContextSave struct {

SaveHandle [TPMIDHContext](#TPMIDHContext)

}

ContextSave is the input to TPM2_ContextSave. See definition in Part 3, Commands, section 28.2

func (ContextSave) Command added in v0.9.0

func (ContextSave) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ContextSaveResponse struct { Context TPMSContext }

ContextSaveResponse is the response from TPM2_ContextSave.

type Create struct {

ParentHandle handle `gotpm:"handle,auth"`

InSensitive [TPM2BSensitiveCreate](#TPM2BSensitiveCreate)

InPublic [TPM2BPublic](#TPM2BPublic)


OutsideInfo [TPM2BData](#TPM2BData)

CreationPCR [TPMLPCRSelection](#TPMLPCRSelection)

}

Create is the input to TPM2_Create. See definition in Part 3, Commands, section 12.1

func (Create) Command added in v0.9.0

func (Create) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type CreateLoaded struct {

ParentHandle handle `gotpm:"handle,auth,nullable"`

InSensitive [TPM2BSensitiveCreate](#TPM2BSensitiveCreate)

InPublic [TPM2BTemplate](#TPM2BTemplate)

}

CreateLoaded is the input to TPM2_CreateLoaded. See definition in Part 3, Commands, section 12.9

func (CreateLoaded) Command added in v0.9.0

func (CreateLoaded) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type CreateLoadedResponse struct {

ObjectHandle [TPMHandle](#TPMHandle) `gotpm:"handle"`

OutPrivate [TPM2BPrivate](#TPM2BPrivate) `gotpm:"optional"`

OutPublic [TPM2BPublic](#TPM2BPublic)

Name [TPM2BName](#TPM2BName)

}

CreateLoadedResponse is the response from TPM2_CreateLoaded.

type CreatePrimary struct {

PrimaryHandle handle `gotpm:"handle,auth"`

InSensitive [TPM2BSensitiveCreate](#TPM2BSensitiveCreate)

InPublic [TPM2BPublic](#TPM2BPublic)


OutsideInfo [TPM2BData](#TPM2BData)

CreationPCR [TPMLPCRSelection](#TPMLPCRSelection)

}

CreatePrimary is the input to TPM2_CreatePrimary. See definition in Part 3, Commands, section 24.1

func (CreatePrimary) Command added in v0.9.0

func (CreatePrimary) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type CreatePrimaryResponse struct {

ObjectHandle [TPMHandle](#TPMHandle) `gotpm:"handle"`

OutPublic [TPM2BPublic](#TPM2BPublic)

CreationData tpm2bCreationData

CreationHash [TPM2BDigest](#TPM2BDigest)


CreationTicket [TPMTTKCreation](#TPMTTKCreation)

Name [TPM2BName](#TPM2BName)

}

CreatePrimaryResponse is the response from TPM2_CreatePrimary.

type CreateResponse struct {

OutPrivate [TPM2BPrivate](#TPM2BPrivate)

OutPublic [TPM2BPublic](#TPM2BPublic)

CreationData tpm2bCreationData

CreationHash [TPM2BDigest](#TPM2BDigest)


CreationTicket [TPMTTKCreation](#TPMTTKCreation)

}

CreateResponse is the response from TPM2_Create.

ECDHPub is a convenience wrapper around the necessary info to perform point multiplication with the elliptic package.

ECCPub converts a TPM ECC public key into one recognized by the elliptic package's point-multiplication functions, for use in ECDH.

type ECDHZGen struct {

KeyHandle handle `gotpm:"handle,auth"`

InPoint [TPM2BECCPoint](#TPM2BECCPoint)

}

ECDHZGen is the input to TPM2_ECDHZGen. See definition in Part 3, Commands, section 14.5

func (ECDHZGen) Command added in v0.9.0

func (ECDHZGen) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ECDHZGenResponse struct {

OutPoint [TPM2BECCPoint](#TPM2BECCPoint)

}

ECDHZGenResponse is the response from TPM2_ECDHZGen.

type FlushContext struct {

FlushHandle handle `gotpm:"handle"`

}

FlushContext is the input to TPM2_FlushContext. See definition in Part 3, Commands, section 28.4

func (FlushContext) Command added in v0.9.0

func (FlushContext) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type FlushContextResponse struct{}

FlushContextResponse is the response from TPM2_FlushContext.

type GetCapability struct {

Capability [TPMCap](#TPMCap)

Property [uint32](/builtin#uint32)

PropertyCount [uint32](/builtin#uint32)

}

GetCapability is the input to TPM2_GetCapability. See definition in Part 3, Commands, section 30.2

func (GetCapability) Command added in v0.9.0

func (GetCapability) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type GetCapabilityResponse struct {

MoreData [TPMIYesNo](#TPMIYesNo)

CapabilityData [TPMSCapabilityData](#TPMSCapabilityData)

}

GetCapabilityResponse is the response from TPM2_GetCapability.

type GetRandom

type GetRandom struct {

BytesRequested [uint16](/builtin#uint16)

}

GetRandom is the input to TPM2_GetRandom. See definition in Part 3, Commands, section 16.1

func (GetRandom) Command added in v0.9.0

func (GetRandom) Command() TPMCC

Command implements the Command interface.

func (GetRandom) Execute added in v0.9.0

Execute executes the command and returns the response.

type GetRandomResponse added in v0.9.0

type GetRandomResponse struct {

RandomBytes [TPM2BDigest](#TPM2BDigest)

}

GetRandomResponse is the response from TPM2_GetRandom.

type GetSessionAuditDigest struct {

PrivacyAdminHandle handle `gotpm:"handle,auth"`

SignHandle handle `gotpm:"handle,auth"`

SessionHandle handle `gotpm:"handle"`

QualifyingData [TPM2BData](#TPM2BData)

InScheme [TPMTSigScheme](#TPMTSigScheme)

}

GetSessionAuditDigest is the input to TPM2_GetSessionAuditDigest. See definition in Part 3, Commands, section 18.5

func (GetSessionAuditDigest) Command added in v0.9.0

func (GetSessionAuditDigest) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type GetSessionAuditDigestResponse struct {

AuditInfo [TPM2BAttest](#TPM2BAttest)

Signature [TPMTSignature](#TPMTSignature)

}

GetSessionAuditDigestResponse is the response from TPM2_GetSessionAuditDigest.

type Hash struct {

Data [TPM2BMaxBuffer](#TPM2BMaxBuffer)

HashAlg [TPMIAlgHash](#TPMIAlgHash)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy) `gotpm:"nullable"`

}

Hash is the input to TPM2_Hash. See definition in Part 3, Commands, section 15.4

func (Hash) Command added in v0.9.0

func (Hash) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type HashResponse struct {

OutHash [TPM2BDigest](#TPM2BDigest)


Validation [TPMTTKHashCheck](#TPMTTKHashCheck)

}

HashResponse is the response from TPM2_Hash.

type HashSequenceStart struct {

Auth [TPM2BAuth](#TPM2BAuth)


HashAlg [TPMIAlgHash](#TPMIAlgHash)

}

HashSequenceStart is the input to TPM2_HashSequenceStart. See definition in Part 3, Commands, section 17.3

func (HashSequenceStart) Command added in v0.9.0

func (HashSequenceStart) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type HashSequenceStartResponse struct {

SequenceHandle [TPMIDHObject](#TPMIDHObject)

}

HashSequenceStartResponse is the response from TPM2_StartHashSequence.

type KDFSchemeContents added in v0.9.0

KDFSchemeContents is a type constraint representing the possible contents of TPMUKDFScheme.

type Load struct {

ParentHandle handle `gotpm:"handle,auth"`

InPrivate [TPM2BPrivate](#TPM2BPrivate)

InPublic [TPM2BPublic](#TPM2BPublic)

}

Load is the input to TPM2_Load. See definition in Part 3, Commands, section 12.2

func (Load) Command added in v0.9.0

func (Load) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type LoadExternal struct {

InPrivate [TPM2BSensitive](#TPM2BSensitive) `gotpm:"optional"`

InPublic [TPM2BPublic](#TPM2BPublic)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy) `gotpm:"nullable"`

}

LoadExternal is the input to TPM2_LoadExternal. See definition in Part 3, Commands, section 12.3

func (LoadExternal) Command added in v0.9.0

func (LoadExternal) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type LoadExternalResponse struct {

ObjectHandle [TPMHandle](#TPMHandle) `gotpm:"handle"`

Name [TPM2BName](#TPM2BName)

}

LoadExternalResponse is the response from TPM2_LoadExternal.

type LoadResponse struct {

ObjectHandle [TPMHandle](#TPMHandle) `gotpm:"handle"`

Name [TPM2BName](#TPM2BName)

}

LoadResponse is the response from TPM2_Load.

type MakeCredential struct {

Handle [TPMIDHObject](#TPMIDHObject) `gotpm:"handle"`

Credential [TPM2BDigest](#TPM2BDigest)

ObjectNamae [TPM2BName](#TPM2BName)

}

MakeCredential is the input to TPM2_MakeCredential. See definition in Part 3, Commands, section 12.6.

func (MakeCredential) Command added in v0.9.0

func (MakeCredential) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type MakeCredentialResponse struct {

CredentialBlob [TPM2BIDObject](#TPM2BIDObject)

Secret [TPM2BEncryptedSecret](#TPM2BEncryptedSecret)

}

MakeCredentialResponse is the response from TPM2_MakeCredential.

type Marshallable interface {

}

Marshallable represents any TPM type that can be marshalled.

type NVCertify struct {

SignHandle handle `gotpm:"handle,auth"`

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

QualifyingData [TPM2BData](#TPM2BData)

InScheme [TPMTSigScheme](#TPMTSigScheme) `gotpm:"nullable"`

Size [uint16](/builtin#uint16)

Offset [uint16](/builtin#uint16)

}

NVCertify is the input to TPM2_NV_Certify. See definition in Part 3, Commands, section 31.16.

func (NVCertify) Command added in v0.9.0

func (NVCertify) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVCertifyResponse struct {

CertifyInfo [TPM2BAttest](#TPM2BAttest)

Signature [TPMTSignature](#TPMTSignature)

}

NVCertifyResponse is the response from TPM2_NV_Read.

type NVDefineSpace struct {

AuthHandle handle `gotpm:"handle,auth"`

Auth [TPM2BAuth](#TPM2BAuth)

PublicInfo [TPM2BNVPublic](#TPM2BNVPublic)

}

NVDefineSpace is the input to TPM2_NV_DefineSpace. See definition in Part 3, Commands, section 31.3.

func (NVDefineSpace) Command added in v0.9.0

func (NVDefineSpace) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVDefineSpaceResponse struct{}

NVDefineSpaceResponse is the response from TPM2_NV_DefineSpace.

type NVIncrement struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

}

NVIncrement is the input to TPM2_NV_Increment. See definition in Part 3, Commands, section 31.8.

func (NVIncrement) Command added in v0.9.0

func (NVIncrement) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVIncrementResponse struct{}

NVIncrementResponse is the response from TPM2_NV_Increment.

type NVRead struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

Size [uint16](/builtin#uint16)

Offset [uint16](/builtin#uint16)

}

NVRead is the input to TPM2_NV_Read. See definition in Part 3, Commands, section 31.13.

func (NVRead) Command added in v0.9.0

func (NVRead) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVReadPublic struct {

NVIndex handle `gotpm:"handle"`

}

NVReadPublic is the input to TPM2_NV_ReadPublic. See definition in Part 3, Commands, section 31.6.

func (NVReadPublic) Command added in v0.9.0

func (NVReadPublic) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVReadPublicResponse struct { NVPublic TPM2BNVPublic NVName TPM2BName }

NVReadPublicResponse is the response from TPM2_NV_ReadPublic.

type NVReadResponse struct {

Data [TPM2BMaxNVBuffer](#TPM2BMaxNVBuffer)

}

NVReadResponse is the response from TPM2_NV_Read.

type NVUndefineSpace struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

}

NVUndefineSpace is the input to TPM2_NV_UndefineSpace. See definition in Part 3, Commands, section 31.4.

func (NVUndefineSpace) Command added in v0.9.0

func (NVUndefineSpace) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVUndefineSpaceResponse struct{}

NVUndefineSpaceResponse is the response from TPM2_NV_UndefineSpace.

type NVUndefineSpaceSpecial struct {

NVIndex handle `gotpm:"handle,auth"`

Platform handle `gotpm:"handle,auth"`

}

NVUndefineSpaceSpecial is the input to TPM2_NV_UndefineSpaceSpecial. See definition in Part 3, Commands, section 31.5.

func (NVUndefineSpaceSpecial) Command added in v0.9.0

func (NVUndefineSpaceSpecial) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVUndefineSpaceSpecialResponse struct{}

NVUndefineSpaceSpecialResponse is the response from TPM2_NV_UndefineSpaceSpecial.

type NVWrite struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

Data [TPM2BMaxNVBuffer](#TPM2BMaxNVBuffer)

Offset [uint16](/builtin#uint16)

}

NVWrite is the input to TPM2_NV_Write. See definition in Part 3, Commands, section 31.7.

func (NVWrite) Command added in v0.9.0

func (NVWrite) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVWriteLock struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

}

NVWriteLock is the input to TPM2_NV_WriteLock. See definition in Part 3, Commands, section 31.11.

func (NVWriteLock) Command added in v0.9.0

func (NVWriteLock) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type NVWriteLockResponse struct{}

NVWriteLockResponse is the response from TPM2_NV_WriteLock.

type NVWriteResponse struct{}

NVWriteResponse is the response from TPM2_NV_Write.

type NamedHandle added in v0.9.0

type NamedHandle struct { Handle TPMHandle Name TPM2BName }

NamedHandle represents an associated pairing of TPM handle and known Name.

func (NamedHandle) HandleValue added in v0.9.0

HandleValue implements the handle interface.

func (NamedHandle) KnownName added in v0.9.0

func (h NamedHandle) KnownName() *TPM2BName

KnownName implements the handle interface.

type PCREvent struct {

PCRHandle handle `gotpm:"handle,auth"`

EventData [TPM2BEvent](#TPM2BEvent)

}

PCREvent is the input to TPM2_PCR_Event. See definition in Part 3, Commands, section 22.3

func (PCREvent) Command added in v0.9.0

func (PCREvent) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type PCREventResponse struct{}

PCREventResponse is the response from TPM2_PCR_Event.

type PCRExtend struct {

PCRHandle handle `gotpm:"handle,auth"`

Digests [TPMLDigestValues](#TPMLDigestValues)

}

PCRExtend is the input to TPM2_PCR_Extend. See definition in Part 3, Commands, section 22.2

func (PCRExtend) Command added in v0.9.0

func (PCRExtend) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type PCRExtendResponse struct{}

PCRExtendResponse is the response from TPM2_PCR_Extend.

type PCRRead struct {

PCRSelectionIn [TPMLPCRSelection](#TPMLPCRSelection)

}

PCRRead is the input to TPM2_PCR_Read. See definition in Part 3, Commands, section 22.4

func (PCRRead) Command added in v0.9.0

func (PCRRead) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type PCRReadResponse struct {

PCRUpdateCounter [uint32](/builtin#uint32)

PCRSelectionOut [TPMLPCRSelection](#TPMLPCRSelection)

PCRValues [TPMLDigest](#TPMLDigest)

}

PCRReadResponse is the response from TPM2_PCR_Read.

type PCRReset struct {

PCRHandle handle `gotpm:"handle,auth"`

}

PCRReset is the input to TPM2_PCRReset. See definition in Part 3, Commands, section 22.8.

func (PCRReset) Command added in v0.9.0

func (PCRReset) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type PCRResetResponse struct{}

PCRResetResponse is the response from TPM2_PCRReset.

type PolicyAuthorize struct {

PolicySession handle `gotpm:"handle"`

ApprovedPolicy [TPM2BDigest](#TPM2BDigest)

PolicyRef [TPM2BDigest](#TPM2BDigest)

KeySign [TPM2BName](#TPM2BName)

CheckTicket [TPMTTKVerified](#TPMTTKVerified)

}

PolicyAuthorize is the input to TPM2_PolicySigned. See definition in Part 3, Commands, section 23.16.

func (PolicyAuthorize) Command added in v0.9.0

func (PolicyAuthorize) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyAuthorizeNV struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

PolicySession handle `gotpm:"handle"`

}

PolicyAuthorizeNV is the input to TPM2_PolicyAuthorizeNV. See definition in Part 3, Commands, section 23.22.

func (PolicyAuthorizeNV) Command added in v0.9.0

func (PolicyAuthorizeNV) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyAuthorizeNVResponse struct{}

PolicyAuthorizeNVResponse is the response from TPM2_PolicyAuthorizeNV.

type PolicyAuthorizeResponse struct{}

PolicyAuthorizeResponse is the response from TPM2_PolicyAuthorize.

type PolicyCPHash struct {

PolicySession handle `gotpm:"handle"`

CPHashA [TPM2BDigest](#TPM2BDigest)

}

PolicyCPHash is the input to TPM2_PolicyCpHash. See definition in Part 3, Commands, section 23.13.

func (PolicyCPHash) Command added in v0.9.0

func (PolicyCPHash) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyCPHashResponse struct{}

PolicyCPHashResponse is the response from TPM2_PolicyCpHash.

type PolicyCalculator struct {

}

PolicyCalculator represents a TPM 2.0 policy that needs to be calculated synthetically (i.e., without a TPM).

func NewPolicyCalculator(alg TPMIAlgHash) (*PolicyCalculator, error)

NewPolicyCalculator creates a fresh policy using the given hash algorithm.

func (p *PolicyCalculator) Hash() *TPMTHA

Hash returns the current state of the policy hash.

func (p *PolicyCalculator) Reset()

Reset resets the internal state of the policy hash to all 0x00.

func (p *PolicyCalculator) Update(data ...interface{}) error

Update updates the internal state of the policy hash by appending the current state with the given contents, and updating the new state to the hash of that.

PolicyCallback represents an object's policy in the form of a function. This function makes zero or more TPM policy commands and returns error.

type PolicyCommand added in v0.9.0

type PolicyCommand interface {

Update(policy *[PolicyCalculator](#PolicyCalculator)) [error](/builtin#error)

}

PolicyCommand is a TPM command that can be part of a TPM policy.

type PolicyCommandCode added in v0.3.0

type PolicyCommandCode struct {

PolicySession handle `gotpm:"handle"`

Code [TPMCC](#TPMCC)

}

PolicyCommandCode is the input to TPM2_PolicyCommandCode. See definition in Part 3, Commands, section 23.11.

func (PolicyCommandCode) Command added in v0.9.0

func (PolicyCommandCode) Command() TPMCC

Command implements the Command interface.

func (PolicyCommandCode) Execute added in v0.9.0

Execute executes the command and returns the response.

func (PolicyCommandCode) Update added in v0.9.0

Update implements the PolicyCommand interface.

type PolicyCommandCodeResponse added in v0.9.0

type PolicyCommandCodeResponse struct{}

PolicyCommandCodeResponse is the response from TPM2_PolicyCommandCode.

type PolicyGetDigest struct {

PolicySession handle `gotpm:"handle"`

}

PolicyGetDigest is the input to TPM2_PolicyGetDigest. See definition in Part 3, Commands, section 23.19.

func (PolicyGetDigest) Command added in v0.9.0

func (PolicyGetDigest) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type PolicyGetDigestResponse struct {

PolicyDigest [TPM2BDigest](#TPM2BDigest)

}

PolicyGetDigestResponse is the response from TPM2_PolicyGetDigest.

type PolicyNV struct {

AuthHandle handle `gotpm:"handle,auth"`

NVIndex handle `gotpm:"handle"`

PolicySession handle `gotpm:"handle"`

OperandB [TPM2BOperand](#TPM2BOperand)

Offset [uint16](/builtin#uint16)

Operation [TPMEO](#TPMEO)

}

PolicyNV is the input to TPM2_PolicyNV. See definition in Part 3, Commands, section 23.9.

func (PolicyNV) Command added in v0.9.0

func (PolicyNV) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyNVResponse struct{}

PolicyNVResponse is the response from TPM2_PolicyPCR.

type PolicyNVWritten struct {

PolicySession handle `gotpm:"handle"`


WrittenSet [TPMIYesNo](#TPMIYesNo)

}

PolicyNVWritten is the input to TPM2_PolicyNvWritten. See definition in Part 3, Commands, section 23.20.

func (PolicyNVWritten) Command added in v0.9.0

func (PolicyNVWritten) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyNVWrittenResponse struct { }

PolicyNVWrittenResponse is the response from TPM2_PolicyNvWritten.

type PolicyOr struct {

PolicySession handle `gotpm:"handle"`

PHashList [TPMLDigest](#TPMLDigest)

}

PolicyOr is the input to TPM2_PolicyOR. See definition in Part 3, Commands, section 23.6.

func (PolicyOr) Command added in v0.9.0

func (PolicyOr) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyOrResponse struct{}

PolicyOrResponse is the response from TPM2_PolicyOr.

type PolicyPCR struct {

PolicySession handle `gotpm:"handle"`


PcrDigest [TPM2BDigest](#TPM2BDigest)

Pcrs [TPMLPCRSelection](#TPMLPCRSelection)

}

PolicyPCR is the input to TPM2_PolicyPCR. See definition in Part 3, Commands, section 23.7.

func (PolicyPCR) Command added in v0.9.0

func (PolicyPCR) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicyPCRResponse struct{}

PolicyPCRResponse is the response from TPM2_PolicyPCR.

type PolicySecret struct {

AuthHandle handle `gotpm:"handle,auth"`

PolicySession handle `gotpm:"handle"`

NonceTPM [TPM2BNonce](#TPM2BNonce)

CPHashA [TPM2BDigest](#TPM2BDigest)

PolicyRef [TPM2BNonce](#TPM2BNonce)


Expiration [int32](/builtin#int32)

}

PolicySecret is the input to TPM2_PolicySecret. See definition in Part 3, Commands, section 23.4.

func (PolicySecret) Command added in v0.9.0

func (PolicySecret) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

func (cmd PolicySecret) Update(policy *PolicyCalculator)

Update implements the PolicyCommand interface.

type PolicySecretResponse struct {

Timeout [TPM2BTimeout](#TPM2BTimeout)

PolicyTicket [TPMTTKAuth](#TPMTTKAuth)

}

PolicySecretResponse is the response from TPM2_PolicySecret.

type PolicySigned struct {

AuthObject handle `gotpm:"handle"`

PolicySession handle `gotpm:"handle"`

NonceTPM [TPM2BNonce](#TPM2BNonce)

CPHashA [TPM2BDigest](#TPM2BDigest)

PolicyRef [TPM2BNonce](#TPM2BNonce)


Expiration [int32](/builtin#int32)

Auth [TPMTSignature](#TPMTSignature)

}

PolicySigned is the input to TPM2_PolicySigned. See definition in Part 3, Commands, section 23.3.

func (PolicySigned) Command added in v0.9.0

func (PolicySigned) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

Update implements the PolicyCommand interface.

type PolicySignedResponse struct {

Timeout [TPM2BTimeout](#TPM2BTimeout)

PolicyTicket [TPMTTKAuth](#TPMTTKAuth)

}

PolicySignedResponse is the response from TPM2_PolicySigned.

type PublicIDContents added in v0.9.0

type PublicIDContents interface { Marshallable *TPM2BDigest | *TPM2BPublicKeyRSA | *TPMSECCPoint }

PublicIDContents is a type constraint representing the possible contents of TPMUPublicID.

type PublicParmsContents added in v0.9.0

type PublicParmsContents interface { Marshallable *TPMSKeyedHashParms | *TPMSSymCipherParms | *TPMSRSAParms | *TPMSECCParms }

PublicParmsContents is a type constraint representing the possible contents of TPMUPublicParms.

type Quote struct {

SignHandle handle `gotpm:"handle,auth"`

QualifyingData [TPM2BData](#TPM2BData)

InScheme [TPMTSigScheme](#TPMTSigScheme)

PCRSelect [TPMLPCRSelection](#TPMLPCRSelection)

}

Quote is the input to TPM2_Quote. See definition in Part 3, Commands, section 18.4

func (Quote) Command added in v0.9.0

func (Quote) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type QuoteResponse struct {

Quoted [TPM2BAttest](#TPM2BAttest)

Signature [TPMTSignature](#TPMTSignature)

}

QuoteResponse is the response from TPM2_Quote.

type ReadPublic struct {

ObjectHandle [TPMIDHObject](#TPMIDHObject) `gotpm:"handle"`

}

ReadPublic is the input to TPM2_ReadPublic. See definition in Part 3, Commands, section 12.4

func (ReadPublic) Command added in v0.9.0

func (ReadPublic) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ReadPublicResponse struct {

OutPublic [TPM2BPublic](#TPM2BPublic)

Name [TPM2BName](#TPM2BName)

QualifiedName [TPM2BName](#TPM2BName)

}

ReadPublicResponse is the response from TPM2_ReadPublic.

type SchemeKeyedHashContents added in v0.9.0

type SchemeKeyedHashContents interface { Marshallable *TPMSSchemeHMAC | *TPMSSchemeXOR }

SchemeKeyedHashContents is a type constraint representing the possible contents of TPMUSchemeKeyedHash.

type SensitiveCompositeContents added in v0.9.0

type SensitiveCompositeContents interface { Marshallable *TPM2BPrivateKeyRSA | *TPM2BECCParameter | *TPM2BSensitiveData | *TPM2BSymKey }

SensitiveCompositeContents is a type constraint representing the possible contents of TPMUSensitiveComposite.

type SensitiveCreateContents added in v0.9.0

type SensitiveCreateContents interface { Marshallable *TPM2BDerive | *TPM2BSensitiveData }

SensitiveCreateContents is a type constraint representing the possible contents of TPMUSensitiveCreate.

type SequenceComplete struct {

SequenceHandle handle `gotpm:"handle,auth"`

Buffer [TPM2BMaxBuffer](#TPM2BMaxBuffer)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy) `gotpm:"nullable"`

}

SequenceComplete is the input to TPM2_SequenceComplete. See definition in Part 3, Commands, section 17.5

func (SequenceComplete) Command added in v0.9.0

func (SequenceComplete) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type SequenceCompleteResponse struct {

Result [TPM2BDigest](#TPM2BDigest)


Validation [TPMTTKHashCheck](#TPMTTKHashCheck)

}

SequenceCompleteResponse is the response from TPM2_SequenceComplete.

type SequenceUpdate struct {

SequenceHandle handle `gotpm:"handle,auth"`

Buffer [TPM2BMaxBuffer](#TPM2BMaxBuffer)

}

SequenceUpdate is the input to TPM2_SequenceUpdate. See definition in Part 3, Commands, section 17.4

func (SequenceUpdate) Command added in v0.9.0

func (SequenceUpdate) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type SequenceUpdateResponse struct{}

SequenceUpdateResponse is the response from TPM2_SequenceUpdate.

type Session interface {

Init(tpm [transport](/github.com/google/go-tpm@v0.9.0/tpm2/transport).[TPM](/github.com/google/go-tpm@v0.9.0/tpm2/transport#TPM)) [error](/builtin#error)


CleanupFailure(tpm [transport](/github.com/google/go-tpm@v0.9.0/tpm2/transport).[TPM](/github.com/google/go-tpm@v0.9.0/tpm2/transport#TPM)) [error](/builtin#error)

NonceTPM() [TPM2BNonce](#TPM2BNonce)

NewNonceCaller() [error](/builtin#error)


Authorize(cc [TPMCC](#TPMCC), parms, addNonces [][byte](/builtin#byte), names [][TPM2BName](#TPM2BName), authIndex [int](/builtin#int)) (*[TPMSAuthCommand](#TPMSAuthCommand), [error](/builtin#error))


Validate(rc [TPMRC](#TPMRC), cc [TPMCC](#TPMCC), parms [][byte](/builtin#byte), names [][TPM2BName](#TPM2BName), authIndex [int](/builtin#int), auth *[TPMSAuthResponse](#TPMSAuthResponse)) [error](/builtin#error)

IsEncryption() [bool](/builtin#bool)

IsDecryption() [bool](/builtin#bool)


Encrypt(parameter [][byte](/builtin#byte)) [error](/builtin#error)


Decrypt(parameter [][byte](/builtin#byte)) [error](/builtin#error)

Handle() [TPMHandle](#TPMHandle)

}

Session represents a session in the TPM.

func HMAC(hash TPMIAlgHash, nonceSize int, opts ...AuthOption) Session

HMAC sets up a just-in-time HMAC session that is used only once. A real session is created, but just in time and it is flushed when used.

HMACSession sets up a reusable HMAC session that needs to be closed.

func PasswordAuth(auth []byte) Session

PasswordAuth assembles a password pseudo-session with the given auth value.

func Policy(hash TPMIAlgHash, nonceSize int, callback PolicyCallback, opts ...AuthOption) Session

Policy sets up a just-in-time policy session that created each time it's needed. Each time the policy is created, the callback is invoked to authorize the session. A real session is created, but just in time, and it is flushed when used.

PolicySession opens a policy session that needs to be closed. The caller is responsible to call whichever policy commands they want in the session. Note that the TPM resets a policy session after it is successfully used.

type Shutdown struct {

ShutdownType [TPMSU](#TPMSU)

}

Shutdown is the input to TPM2_Shutdown. See definition in Part 3, Commands, section 9.4.

func (Shutdown) Command added in v0.9.0

func (Shutdown) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type ShutdownResponse struct{}

ShutdownResponse is the response from TPM2_Shutdown.

type SigSchemeContents added in v0.9.0

type SigSchemeContents interface { Marshallable *TPMSSchemeHMAC | *TPMSSchemeHash | *TPMSSchemeECDAA }

SigSchemeContents is a type constraint representing the possible contents of TPMUSigScheme.

type Sign struct {

KeyHandle handle `gotpm:"handle,auth"`

Digest [TPM2BDigest](#TPM2BDigest)

InScheme [TPMTSigScheme](#TPMTSigScheme) `gotpm:"nullable"`


Validation [TPMTTKHashCheck](#TPMTTKHashCheck)

}

Sign is the input to TPM2_Sign. See definition in Part 3, Commands, section 20.2.

func (Sign) Command added in v0.9.0

func (Sign) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type SignResponse struct {

Signature [TPMTSignature](#TPMTSignature)

}

SignResponse is the response from TPM2_Sign.

type SignatureContents added in v0.9.0

type SignatureContents interface { Marshallable *TPMTHA | *TPMSSignatureRSA | *TPMSSignatureECC }

SignatureContents is a type constraint representing the possible contents of TPMUSignature.

type StartAuthSession struct {

TPMKey handle `gotpm:"handle,nullable"`


Bind handle `gotpm:"handle,nullable"`


NonceCaller [TPM2BNonce](#TPM2BNonce)


EncryptedSalt [TPM2BEncryptedSecret](#TPM2BEncryptedSecret)


SessionType [TPMSE](#TPMSE)


Symmetric [TPMTSymDef](#TPMTSymDef)


AuthHash [TPMIAlgHash](#TPMIAlgHash)

}

StartAuthSession is the input to TPM2_StartAuthSession. See definition in Part 3, Commands, section 11.1

func (StartAuthSession) Command added in v0.9.0

func (StartAuthSession) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type StartAuthSessionResponse struct {

SessionHandle [TPMISHAuthSession](#TPMISHAuthSession) `gotpm:"handle"`

NonceTPM [TPM2BNonce](#TPM2BNonce)

}

StartAuthSessionResponse is the response from TPM2_StartAuthSession.

type Startup struct {

StartupType [TPMSU](#TPMSU)

}

Startup is the input to TPM2_Startup. See definition in Part 3, Commands, section 9.3.

func (Startup) Command added in v0.9.0

func (Startup) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type StartupResponse struct{}

StartupResponse is the response from TPM2_Startup.

type SymDetailsContents added in v0.9.0

type SymDetailsContents interface { TPMSEmpty }

SymDetailsContents is a type constraint representing the possible contents of TPMUSymDetails.

type SymKeyBitsContents added in v0.9.0

type SymKeyBitsContents interface { TPMKeyBits | TPMAlgID }

SymKeyBitsContents is a type constraint representing the possible contents of TPMUSymKeyBits.

type SymModeContents added in v0.9.0

type SymModeContents interface { TPMIAlgSymMode | TPMSEmpty }

SymModeContents is a type constraint representing the possible contents of TPMUSymMode.

type TPM2B[T Marshallable, P interface { *T Unmarshallable }] struct {

}

TPM2B is a helper type for all sized TPM structures. It can be instantiated with either a raw byte buffer or the actual struct.

func BytesAs2B[T Marshallable, P interface { *T Unmarshallable }](b []byte) TPM2B[T, P]

BytesAs2B creates a new TPM2B containing the given byte array.

func New2B[T Marshallable, P interface { *T Unmarshallable }](t T) TPM2B[T, P]

New2B creates a new TPM2B containing the given contents.

func (value *TPM2B[T, P]) Bytes() []byte

Bytes returns the inner contents of the TPM2B as a byte array, not including the length field.

func (*TPM2B[T, P]) Contents added in v0.9.0

func (value *TPM2B[T, P]) Contents() (*T, error)

Contents returns the structured contents of the TPM2B. It can fail if the TPM2B was instantiated with an invalid byte buffer.

type TPM2BAttest = TPM2B[TPMSAttest, *TPMSAttest]

TPM2BAttest represents a TPM2B_ATTEST. See definition in Part 2: Structures, section 10.12.13.

type TPM2BAuth TPM2BDigest

TPM2BAuth represents a TPM2B_AUTH. See definition in Part 2: Structures, section 10.4.5.

type TPM2BContextData TPM2BData

TPM2BContextData represents a TPM2B_CONTEXT_DATA See definition in Part 2: Structures, section 14.4. Represented here as a flat buffer because how a TPM chooses to represent its context data is implementation-dependent.

type TPM2BContextSensitive TPM2BData

TPM2BContextSensitive represents a TPM2B_CONTEXT_SENSITIVE See definition in Part 2: Structures, section 14.2.

type TPM2BData struct {

Buffer [][byte](/builtin#byte) `gotpm:"sized"`

}

TPM2BData represents a TPM2B_DATA. See definition in Part 2: Structures, section 10.4.3.

type TPM2BDerive = TPM2B[TPMSDerive, *TPMSDerive]

TPM2BDerive represents a TPM2B_DERIVE. See definition in Part 2: Structures, section 11.1.12.

type TPM2BDigest TPM2BData

TPM2BDigest represents a TPM2B_DIGEST. See definition in Part 2: Structures, section 10.4.2.

CPHash calculates the TPM command parameter hash for a given Command. N.B. Authorization sessions on handles are ignored, but names aren't.

type TPM2BECCParameter TPM2BData

TPM2BECCParameter represents a TPM2B_ECC_PARAMETER. See definition in Part 2: Structures, section 11.2.5.1.

type TPM2BECCPoint = TPM2B[TPMSECCPoint, *TPMSECCPoint]

TPM2BECCPoint represents a TPM2B_ECC_POINT. See definition in Part 2: Structures, section 11.2.5.3.

type TPM2BEncryptedSecret TPM2BData

TPM2BEncryptedSecret represents a TPM2B_ENCRYPTED_SECRET. See definition in Part 2: Structures, section 11.4.33.

type TPM2BEvent TPM2BData

TPM2BEvent represents a TPM2B_EVENT. See definition in Part 2: Structures, section 10.4.7.

type TPM2BIDObject TPM2BData

TPM2BIDObject represents a TPM2B_ID_OBJECT. See definition in Part 2: Structures, section 12.4.3.

type TPM2BLabel TPM2BData

TPM2BLabel represents a TPM2B_LABEL. See definition in Part 2: Structures, section 11.1.10.

type TPM2BMaxBuffer TPM2BData

TPM2BMaxBuffer represents a TPM2B_MAX_BUFFER. See definition in Part 2: Structures, section 10.4.8.

type TPM2BMaxNVBuffer TPM2BData

TPM2BMaxNVBuffer represents a TPM2B_MAX_NV_BUFFER. See definition in Part 2: Structures, section 10.4.9.

type TPM2BNVPublic = TPM2B[TPMSNVPublic, *TPMSNVPublic]

TPM2BNVPublic represents a TPM2B_NV_PUBLIC. See definition in Part 2: Structures, section 13.6.

TPM2BName represents a TPM2B_NAME. See definition in Part 2: Structures, section 10.5.3. NOTE: This structure does not contain a TPMUName, because that union is not tagged with a selector. Instead, TPM2B_Name is flattened and all TPMDirect helpers that deal with names will deal with them as so.

func HandleName added in v0.9.0

func HandleName(h TPMHandle) TPM2BName

HandleName returns the TPM Name of a PCR, session, or permanent value (e.g., hierarchy) handle.

NVName returns the TPM Name of an NV index.

ObjectName returns the TPM Name of an object.

type TPM2BNonce TPM2BDigest

TPM2BNonce represents a TPM2B_NONCE. See definition in Part 2: Structures, section 10.4.4.

type TPM2BOperand added in v0.9.0

type TPM2BOperand TPM2BDigest

TPM2BOperand represents a TPM2B_Operand. See definition in Part 2: Structures, section 10.4.6.

type TPM2BPrivate TPM2BData

TPM2BPrivate represents a TPM2B_PRIVATE. See definition in Part 2: Structures, section 12.3.7.

type TPM2BPrivateKeyRSA TPM2BData

TPM2BPrivateKeyRSA representsa a TPM2B_PRIVATE_KEY_RSA. See definition in Part 2: Structures, section 11.2.4.7.

type TPM2BPublic = TPM2B[TPMTPublic, *TPMTPublic]

TPM2BPublic represents a TPM2B_PUBLIC. See definition in Part 2: Structures, section 12.2.5.

type TPM2BPublicKeyRSA TPM2BData

TPM2BPublicKeyRSA represents a TPM2B_PUBLIC_KEY_RSA. See definition in Part 2: Structures, section 11.2.4.5.

type TPM2BSensitive = TPM2B[TPMTSensitive, *TPMTSensitive]

TPM2BSensitive represents a TPM2B_SENSITIVE. See definition in Part 2: Structures, section 12.3.3.

type TPM2BSensitiveCreate struct { Sensitive *TPMSSensitiveCreate }

TPM2BSensitiveCreate represents a TPM2B_SENSITIVE_CREATE. See definition in Part 2: Structures, section 11.1.16. This is a structure instead of an alias to TPM2B[TPMSSensitiveCreate], because it has custom marshalling logic for zero-valued parameters.

type TPM2BSensitiveData TPM2BData

TPM2BSensitiveData represents a TPM2B_SENSITIVE_DATA. See definition in Part 2: Structures, section 11.1.14.

type TPM2BSymKey TPM2BData

TPM2BSymKey represents a TPM2B_SYM_KEY. See definition in Part 2: Structures, section 11.1.8.

type TPM2BTemplate TPM2BData

TPM2BTemplate represents a TPM2B_TEMPLATE. See definition in Part 2: Structures, section 12.2.6.

func New2BTemplate[C TemplateContents](data C) TPM2BTemplate

New2BTemplate creates a TPM2BTemplate with the given data.

type TPM2BTimeout TPM2BData

TPM2BTimeout represents a TPM2B_TIMEOUT. See definition in Part 2: Structures, section 10.4.10.

type TPMAACT struct {

Signaled [bool](/builtin#bool) `gotpm:"bit=0"`


PreserveSignaled [bool](/builtin#bool) `gotpm:"bit=1"`

}

TPMAACT represents a TPMA_ACT. See definition in Part 2: Structures, section 8.12.

func (r TPMAACT) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMAACT) Length() int

Length implements the Bitfield interface.

func (r *TPMAACT) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

type TPMAAlgorithm struct {

Asymmetric [bool](/builtin#bool) `gotpm:"bit=0"`


Symmetric [bool](/builtin#bool) `gotpm:"bit=1"`


Hash [bool](/builtin#bool) `gotpm:"bit=2"`


Object [bool](/builtin#bool) `gotpm:"bit=3"`


Signing [bool](/builtin#bool) `gotpm:"bit=8"`


Encrypting [bool](/builtin#bool) `gotpm:"bit=9"`


Method [bool](/builtin#bool) `gotpm:"bit=10"`

}

TPMAAlgorithm represents a TPMA_ALGORITHM. See definition in Part 2: Structures, section 8.2.

func (r TPMAAlgorithm) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMAAlgorithm) Length() int

Length implements the Bitfield interface.

func (r *TPMAAlgorithm) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

type TPMACC struct {

CommandIndex [uint16](/builtin#uint16) `gotpm:"bit=15:0"`


NV [bool](/builtin#bool) `gotpm:"bit=22"`


Extensive [bool](/builtin#bool) `gotpm:"bit=23"`


Flushed [bool](/builtin#bool) `gotpm:"bit=24"`

CHandles [uint8](/builtin#uint8) `gotpm:"bit=27:25"`

RHandle [bool](/builtin#bool) `gotpm:"bit=28"`


V [bool](/builtin#bool) `gotpm:"bit=29"`

}

TPMACC represents a TPMA_CC. See definition in Part 2: Structures, section 8.9.

func (r TPMACC) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMACC) Length() int

Length implements the Bitfield interface.

func (r *TPMACC) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

type TPMALocality struct { TPMLocZero bool gotpm:"bit=0" TPMLocOne bool gotpm:"bit=1" TPMLocTwo bool gotpm:"bit=2" TPMLocThree bool gotpm:"bit=3" TPMLocFour bool gotpm:"bit=4"

Extended [uint8](/builtin#uint8) `gotpm:"bit=7:5"`

}

TPMALocality represents a TPMA_LOCALITY. See definition in Part 2: Structures, section 8.5.

func (r TPMALocality) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMALocality) Length() int

Length implements the Bitfield interface.

func (r *TPMALocality) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

type TPMANV struct {

PPWrite [bool](/builtin#bool) `gotpm:"bit=0"`


OwnerWrite [bool](/builtin#bool) `gotpm:"bit=1"`


AuthWrite [bool](/builtin#bool) `gotpm:"bit=2"`


PolicyWrite [bool](/builtin#bool) `gotpm:"bit=3"`

NT [TPMNT](#TPMNT) `gotpm:"bit=7:4"`


PolicyDelete [bool](/builtin#bool) `gotpm:"bit=10"`


WriteLocked [bool](/builtin#bool) `gotpm:"bit=11"`


WriteAll [bool](/builtin#bool) `gotpm:"bit=12"`


WriteDefine [bool](/builtin#bool) `gotpm:"bit=13"`


WriteSTClear [bool](/builtin#bool) `gotpm:"bit=14"`


GlobalLock [bool](/builtin#bool) `gotpm:"bit=15"`


PPRead [bool](/builtin#bool) `gotpm:"bit=16"`


OwnerRead [bool](/builtin#bool) `gotpm:"bit=17"`


AuthRead [bool](/builtin#bool) `gotpm:"bit=18"`


PolicyRead [bool](/builtin#bool) `gotpm:"bit=19"`


NoDA [bool](/builtin#bool) `gotpm:"bit=25"`


Orderly [bool](/builtin#bool) `gotpm:"bit=26"`


ClearSTClear [bool](/builtin#bool) `gotpm:"bit=27"`


ReadLocked [bool](/builtin#bool) `gotpm:"bit=28"`


Written [bool](/builtin#bool) `gotpm:"bit=29"`


PlatformCreate [bool](/builtin#bool) `gotpm:"bit=30"`


ReadSTClear [bool](/builtin#bool) `gotpm:"bit=31"`

}

TPMANV represents a TPMA_NV. See definition in Part 2: Structures, section 13.4.

func (r TPMANV) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMANV) Length() int

Length implements the Bitfield interface.

func (r *TPMANV) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

type TPMAObject struct {

FixedTPM [bool](/builtin#bool) `gotpm:"bit=1"`


STClear [bool](/builtin#bool) `gotpm:"bit=2"`


FixedParent [bool](/builtin#bool) `gotpm:"bit=4"`


SensitiveDataOrigin [bool](/builtin#bool) `gotpm:"bit=5"`


UserWithAuth [bool](/builtin#bool) `gotpm:"bit=6"`


AdminWithPolicy [bool](/builtin#bool) `gotpm:"bit=7"`


NoDA [bool](/builtin#bool) `gotpm:"bit=10"`


EncryptedDuplication [bool](/builtin#bool) `gotpm:"bit=11"`


Restricted [bool](/builtin#bool) `gotpm:"bit=16"`


Decrypt [bool](/builtin#bool) `gotpm:"bit=17"`


SignEncrypt [bool](/builtin#bool) `gotpm:"bit=18"`


X509Sign [bool](/builtin#bool) `gotpm:"bit=19"`

}

TPMAObject represents a TPMA_OBJECT. See definition in Part 2: Structures, section 8.3.2.

func (r TPMAObject) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMAObject) Length() int

Length implements the Bitfield interface.

func (r *TPMAObject) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

type TPMASession struct {

ContinueSession [bool](/builtin#bool) `gotpm:"bit=0"`


AuditExclusive [bool](/builtin#bool) `gotpm:"bit=1"`


AuditReset [bool](/builtin#bool) `gotpm:"bit=2"`


Decrypt [bool](/builtin#bool) `gotpm:"bit=5"`


Encrypt [bool](/builtin#bool) `gotpm:"bit=6"`


Audit [bool](/builtin#bool) `gotpm:"bit=7"`

}

TPMASession represents a TPMA_SESSION. See definition in Part 2: Structures, section 8.4.

func (r TPMASession) GetReservedBit(pos int) bool

GetReservedBit implements the BitGetter interface.

func (TPMASession) Length() int

Length implements the Bitfield interface.

func (r *TPMASession) SetReservedBit(pos int, val bool)

SetReservedBit implements the BitSetter interface.

TPMAlgID represents a TPM_ALG_ID. See definition in Part 2: Structures, section 6.3.

const ( TPMAlgRSA TPMAlgID = 0x0001 TPMAlgTDES TPMAlgID = 0x0003 TPMAlgSHA1 TPMAlgID = 0x0004 TPMAlgHMAC TPMAlgID = 0x0005 TPMAlgAES TPMAlgID = 0x0006 TPMAlgMGF1 TPMAlgID = 0x0007 TPMAlgKeyedHash TPMAlgID = 0x0008 TPMAlgXOR TPMAlgID = 0x000A TPMAlgSHA256 TPMAlgID = 0x000B TPMAlgSHA384 TPMAlgID = 0x000C TPMAlgSHA512 TPMAlgID = 0x000D TPMAlgNull TPMAlgID = 0x0010 TPMAlgSM3256 TPMAlgID = 0x0012 TPMAlgSM4 TPMAlgID = 0x0013 TPMAlgRSASSA TPMAlgID = 0x0014 TPMAlgRSAES TPMAlgID = 0x0015 TPMAlgRSAPSS TPMAlgID = 0x0016 TPMAlgOAEP TPMAlgID = 0x0017 TPMAlgECDSA TPMAlgID = 0x0018 TPMAlgECDH TPMAlgID = 0x0019 TPMAlgECDAA TPMAlgID = 0x001A TPMAlgSM2 TPMAlgID = 0x001B TPMAlgECSchnorr TPMAlgID = 0x001C TPMAlgECMQV TPMAlgID = 0x001D TPMAlgKDF1SP80056A TPMAlgID = 0x0020 TPMAlgKDF2 TPMAlgID = 0x0021 TPMAlgKDF1SP800108 TPMAlgID = 0x0022 TPMAlgECC TPMAlgID = 0x0023 TPMAlgSymCipher TPMAlgID = 0x0025 TPMAlgCamellia TPMAlgID = 0x0026 TPMAlgSHA3256 TPMAlgID = 0x0027 TPMAlgSHA3384 TPMAlgID = 0x0028 TPMAlgSHA3512 TPMAlgID = 0x0029 TPMAlgCMAC TPMAlgID = 0x003F TPMAlgCTR TPMAlgID = 0x0040 TPMAlgOFB TPMAlgID = 0x0041 TPMAlgCBC TPMAlgID = 0x0042 TPMAlgCFB TPMAlgID = 0x0043 TPMAlgECB TPMAlgID = 0x0044 )

TPMAlgID values come from Part 2: Structures, section 6.3.

TPMAlgorithmID represents a TPM_ALGORITHM_ID this is the 1.2 compatible form of the TPM_ALG_ID See definition in Part 2, Structures, section 5.3.

type TPMAuthorizationSize uint32

TPMAuthorizationSize represents a TPM_AUTHORIZATION_SIZE. the authorizationSize parameter in a command See definition in Part 2, Structures, section 5.3.

TPMCC represents a TPM_CC. See definition in Part 2: Structures, section 6.5.2.

const ( TPMCCNVUndefineSpaceSpecial TPMCC = 0x0000011F TPMCCEvictControl TPMCC = 0x00000120 TPMCCHierarchyControl TPMCC = 0x00000121 TPMCCNVUndefineSpace TPMCC = 0x00000122 TPMCCChangeEPS TPMCC = 0x00000124 TPMCCChangePPS TPMCC = 0x00000125 TPMCCClear TPMCC = 0x00000126 TPMCCClearControl TPMCC = 0x00000127 TPMCCClockSet TPMCC = 0x00000128 TPMCCHierarchyChanegAuth TPMCC = 0x00000129 TPMCCNVDefineSpace TPMCC = 0x0000012A TPMCCPCRAllocate TPMCC = 0x0000012B TPMCCPCRSetAuthPolicy TPMCC = 0x0000012C TPMCCPPCommands TPMCC = 0x0000012D TPMCCSetPrimaryPolicy TPMCC = 0x0000012E TPMCCFieldUpgradeStart TPMCC = 0x0000012F TPMCCClockRateAdjust TPMCC = 0x00000130 TPMCCCreatePrimary TPMCC = 0x00000131 TPMCCNVGlobalWriteLock TPMCC = 0x00000132 TPMCCGetCommandAuditDigest TPMCC = 0x00000133 TPMCCNVIncrement TPMCC = 0x00000134 TPMCCNVSetBits TPMCC = 0x00000135 TPMCCNVExtend TPMCC = 0x00000136 TPMCCNVWrite TPMCC = 0x00000137 TPMCCNVWriteLock TPMCC = 0x00000138 TPMCCDictionaryAttackLockReset TPMCC = 0x00000139 TPMCCDictionaryAttackParameters TPMCC = 0x0000013A TPMCCNVChangeAuth TPMCC = 0x0000013B TPMCCPCREvent TPMCC = 0x0000013C TPMCCPCRReset TPMCC = 0x0000013D TPMCCSequenceComplete TPMCC = 0x0000013E TPMCCSetAlgorithmSet TPMCC = 0x0000013F TPMCCSetCommandCodeAuditStatus TPMCC = 0x00000140 TPMCCFieldUpgradeData TPMCC = 0x00000141 TPMCCIncrementalSelfTest TPMCC = 0x00000142 TPMCCSelfTest TPMCC = 0x00000143 TPMCCStartup TPMCC = 0x00000144 TPMCCShutdown TPMCC = 0x00000145 TPMCCStirRandom TPMCC = 0x00000146 TPMCCActivateCredential TPMCC = 0x00000147 TPMCCCertify TPMCC = 0x00000148 TPMCCPolicyNV TPMCC = 0x00000149 TPMCCCertifyCreation TPMCC = 0x0000014A TPMCCDuplicate TPMCC = 0x0000014B TPMCCGetTime TPMCC = 0x0000014C TPMCCGetSessionAuditDigest TPMCC = 0x0000014D TPMCCNVRead TPMCC = 0x0000014E TPMCCNVReadLock TPMCC = 0x0000014F TPMCCObjectChangeAuth TPMCC = 0x00000150 TPMCCPolicySecret TPMCC = 0x00000151 TPMCCRewrap TPMCC = 0x00000152 TPMCCCreate TPMCC = 0x00000153 TPMCCECDHZGen TPMCC = 0x00000154 TPMCCMAC TPMCC = 0x00000155 TPMCCImport TPMCC = 0x00000156 TPMCCLoad TPMCC = 0x00000157 TPMCCQuote TPMCC = 0x00000158 TPMCCRSADecrypt TPMCC = 0x00000159 TPMCCMACStart TPMCC = 0x0000015B TPMCCSequenceUpdate TPMCC = 0x0000015C TPMCCSign TPMCC = 0x0000015D TPMCCUnseal TPMCC = 0x0000015E TPMCCPolicySigned TPMCC = 0x00000160 TPMCCContextLoad TPMCC = 0x00000161 TPMCCContextSave TPMCC = 0x00000162 TPMCCECDHKeyGen TPMCC = 0x00000163 TPMCCEncryptDecrypt TPMCC = 0x00000164 TPMCCFlushContext TPMCC = 0x00000165 TPMCCLoadExternal TPMCC = 0x00000167 TPMCCMakeCredential TPMCC = 0x00000168 TPMCCNVReadPublic TPMCC = 0x00000169 TPMCCPolicyAuthorize TPMCC = 0x0000016A TPMCCPolicyAuthValue TPMCC = 0x0000016B TPMCCPolicyCommandCode TPMCC = 0x0000016C TPMCCPolicyCounterTimer TPMCC = 0x0000016D TPMCCPolicyCpHash TPMCC = 0x0000016E TPMCCPolicyLocality TPMCC = 0x0000016F TPMCCPolicyNameHash TPMCC = 0x00000170 TPMCCPolicyOR TPMCC = 0x00000171 TPMCCPolicyTicket TPMCC = 0x00000172 TPMCCReadPublic TPMCC = 0x00000173 TPMCCRSAEncrypt TPMCC = 0x00000174 TPMCCStartAuthSession TPMCC = 0x00000176 TPMCCVerifySignature TPMCC = 0x00000177 TPMCCECCParameters TPMCC = 0x00000178 TPMCCFirmwareRead TPMCC = 0x00000179 TPMCCGetCapability TPMCC = 0x0000017A TPMCCGetRandom TPMCC = 0x0000017B TPMCCGetTestResult TPMCC = 0x0000017C TPMCCHash TPMCC = 0x0000017D TPMCCPCRRead TPMCC = 0x0000017E TPMCCPolicyPCR TPMCC = 0x0000017F TPMCCPolicyRestart TPMCC = 0x00000180 TPMCCReadClock TPMCC = 0x00000181 TPMCCPCRExtend TPMCC = 0x00000182 TPMCCPCRSetAuthValue TPMCC = 0x00000183 TPMCCNVCertify TPMCC = 0x00000184 TPMCCEventSequenceComplete TPMCC = 0x00000185 TPMCCHashSequenceStart TPMCC = 0x00000186 TPMCCPolicyPhysicalPresence TPMCC = 0x00000187 TPMCCPolicyDuplicationSelect TPMCC = 0x00000188 TPMCCPolicyGetDigest TPMCC = 0x00000189 TPMCCTestParams TPMCC = 0x0000018A TPMCCCommit TPMCC = 0x0000018B TPMCCPolicyPassword TPMCC = 0x0000018C TPMCCZGen2Phase TPMCC = 0x0000018D TPMCCECEphemeral TPMCC = 0x0000018E TPMCCPolicyNvWritten TPMCC = 0x0000018F TPMCCPolicyTemplate TPMCC = 0x00000190 TPMCCCreateLoaded TPMCC = 0x00000191 TPMCCPolicyAuthorizeNV TPMCC = 0x00000192 TPMCCEncryptDecrypt2 TPMCC = 0x00000193 TPMCCACGetCapability TPMCC = 0x00000194 TPMCCACSend TPMCC = 0x00000195 TPMCCPolicyACSendSelect TPMCC = 0x00000196 TPMCCCertifyX509 TPMCC = 0x00000197 TPMCCACTSetTimeout TPMCC = 0x00000198 )

TPMCC values come from Part 2: Structures, section 6.5.2.

TPMCap represents a TPM_CAP. See definition in Part 2: Structures, section 6.12.

const ( TPMCapAlgs TPMCap = 0x00000000 TPMCapHandles TPMCap = 0x00000001 TPMCapCommands TPMCap = 0x00000002 TPMCapPPCommands TPMCap = 0x00000003 TPMCapAuditCommands TPMCap = 0x00000004 TPMCapPCRs TPMCap = 0x00000005 TPMCapTPMProperties TPMCap = 0x00000006 TPMCapPCRProperties TPMCap = 0x00000007 TPMCapECCCurves TPMCap = 0x00000008 TPMCapAuthPolicies TPMCap = 0x00000009 TPMCapACT TPMCap = 0x0000000A )

TPMCap values come from Part 2: Structures, section 6.12.

type TPMCmdHeader struct { CommandCode TPMCC

}

TPMCmdHeader is the header structure in front of any TPM command. It is described in Part 1, Architecture.

TPMECCCurve represents a TPM_ECC_Curve. See definition in Part 2: Structures, section 6.4.

const ( TPMECCNone TPMECCCurve = 0x0000 TPMECCNistP192 TPMECCCurve = 0x0001 TPMECCNistP224 TPMECCCurve = 0x0002 TPMECCNistP256 TPMECCCurve = 0x0003 TPMECCNistP384 TPMECCCurve = 0x0004 TPMECCNistP521 TPMECCCurve = 0x0005 TPMECCBNP256 TPMECCCurve = 0x0010 TPMECCBNP638 TPMECCCurve = 0x0011 TPMECCSM2P256 TPMECCCurve = 0x0020 )

TPMECCCurve values come from Part 2: Structures, section 6.4.

Curve returns the elliptic.Curve associated with a TPMECCCurve.

TPMEO represents a TPM_EO. See definition in Part 2: Structures, section 6.8.

const ( TPMEOEq TPMEO = 0x0000 TPMEONeq TPMEO = 0x0001 TPMEOSignedGT TPMEO = 0x0002 TPMEOUnsignedGT TPMEO = 0x0003 TPMEOSignedLT TPMEO = 0x0004 TPMEOUnsignedLT TPMEO = 0x0005 TPMEOSignedGE TPMEO = 0x0006 TPMEOUnsignedGE TPMEO = 0x0007 TPMEOSignedLE TPMEO = 0x0008 TPMEOUnsignedLE TPMEO = 0x0009 TPMEOBitSet TPMEO = 0x000A TPMEOBitClear TPMEO = 0x000B )

TPMEO values come from Part 2: Structures, section 6.8.

type TPMFmt1Error struct {

}

TPMFmt1Error represents a TPM 2.0 format-1 error, with additional information.

Error returns the string representation of the error.

func (TPMFmt1Error) Handle added in v0.9.0

Handle returns whether the error is handle-related and if so, which handle is in error.

Parameter returns whether the error is handle-related and if so, which handle is in error.

Session returns whether the error is handle-related and if so, which handle is in error.

TPMGenerated represents a TPM_GENERATED. See definition in Part 2: Structures, section 6.2.

const ( TPMGeneratedValue TPMGenerated = 0xff544347 )

Generated values come from Part 2: Structures, section 6.2.

Check verifies that a TPMGenerated value is correct, and returns an error otherwise.

TPMHT represents a TPM_HT. See definition in Part 2: Structures, section 7.2.

const ( TPMHTPCR TPMHT = 0x00 TPMHTNVIndex TPMHT = 0x01 TPMHTHMACSession TPMHT = 0x02 TPMHTPolicySession TPMHT = 0x03 TPMHTPermanent TPMHT = 0x40 TPMHTTransient TPMHT = 0x80 TPMHTPersistent TPMHT = 0x81 TPMHTAC TPMHT = 0x90 )

TPMHT values come from Part 2: Structures, section 7.2.

type TPMHandle added in v0.9.0

TPMHandle represents a TPM_HANDLE. See definition in Part 2: Structures, section 7.1.

const ( TPMRHOwner TPMHandle = 0x40000001 TPMRHNull TPMHandle = 0x40000007 TPMRSPW TPMHandle = 0x40000009 TPMRHLockout TPMHandle = 0x4000000A TPMRHEndorsement TPMHandle = 0x4000000B TPMRHPlatform TPMHandle = 0x4000000C TPMRHPlatformNV TPMHandle = 0x4000000D )

TPMHandle values come from Part 2: Structures, section 7.4.

func (TPMHandle) HandleValue added in v0.9.0

HandleValue returns the handle value. This behavior is intended to satisfy an interface that can be implemented by other, more complex types as well.

func (TPMHandle) KnownName added in v0.9.0

func (h TPMHandle) KnownName() *TPM2BName

KnownName returns the TPM Name associated with the handle, if it can be known based only on the handle. This depends upon the value of the handle: only PCR, session, and permanent values have known constant Names. See definition in part 1: Architecture, section 16.

type TPMIAlgECCScheme = TPMAlgID

TPMIAlgECCScheme represents a TPMI_ALG_ECC_SCHEME. See definition in Part 2: Structures, section 11.2.5.4.

type TPMIAlgHash = TPMAlgID

TPMIAlgHash represents a TPMI_ALG_HASH. See definition in Part 2: Structures, section 9.27.

Hash returns the crypto.Hash associated with a TPMIAlgHash.

type TPMIAlgKDF = TPMAlgID

TPMIAlgKDF represents a TPMI_ALG_KDF. See definition in Part 2: Structures, section 9.32.

type TPMIAlgKeyedHashScheme = TPMAlgID

TPMIAlgKeyedHashScheme represents a TPMI_ALG_KEYEDHASH_SCHEME. See definition in Part 2: Structures, section 11.1.19.

type TPMIAlgPublic = TPMAlgID

TPMIAlgPublic represents a TPMI_ALG_PUBLIC. See definition in Part 2: Structures, section 12.2.2.

type TPMIAlgRSAScheme = TPMAlgID

TPMIAlgRSAScheme represents a TPMI_ALG_RSA_SCHEME. See definition in Part 2: Structures, section 11.2.4.1.

type TPMIAlgSigScheme = TPMAlgID

TPMIAlgSigScheme represents a TPMI_ALG_SIG_SCHEME. See definition in Part 2: Structures, section 9.33.

type TPMIAlgSym = TPMAlgID

TPMIAlgSym represents a TPMI_ALG_SYM. See definition in Part 2: Structures, section 9.29.

type TPMIAlgSymMode = TPMAlgID

TPMIAlgSymMode represents a TPMI_ALG_SYM_MODE. See definition in Part 2: Structures, section 9.31.

type TPMIAlgSymObject = TPMAlgID

TPMIAlgSymObject represents a TPMI_ALG_SYM_OBJECT. See definition in Part 2: Structures, section 9.30.

type TPMIDHContext = TPMHandle

TPMIDHContext represents a TPMI_DH_CONTEXT. See definition in Part 2: Structures, section 9.11.

type TPMIDHEntity = TPMHandle

TPMIDHEntity represents a TPMI_DH_ENTITY. See definition in Part 2: Structures, section 9.6.

type TPMIDHObject = TPMHandle

TPMIDHObject represents a TPMI_DH_OBJECT. See definition in Part 2: Structures, section 9.3.

type TPMIDHSaved = TPMHandle

TPMIDHSaved represents a TPMI_DH_SAVED. See definition in Part 2: Structures, section 9.12.

type TPMIECCCurve = TPMECCCurve

TPMIECCCurve represents a TPMI_ECC_CURVE. See definition in Part 2: Structures, section 11.2.5.5.

type TPMIRHAC = TPMHandle

TPMIRHAC represents a TPMI_RH_AC. See definition in Part 2: Structures, section 9.25.

type TPMIRHACT = TPMHandle

TPMIRHACT represents a TPMI_RH_ACT. See definition in Part 2: Structures, section 9.26.

type TPMIRHClear = TPMHandle

TPMIRHClear represents a TPMI_RH_CLEAR. See definition in Part 2: Structures, section 9.21.

type TPMIRHEnables = TPMHandle

TPMIRHEnables represents a TPMI_RH_ENABLES. See definition in Part 2: Structures, section 9.14.

type TPMIRHEndorsement = TPMHandle

TPMIRHEndorsement represents a TPMI_RH_ENDORSEMENT. See definition in Part 2: Structures, section 9.19.

type TPMIRHHierarchy = TPMHandle

TPMIRHHierarchy represents a TPMI_RH_HIERARCHY. See definition in Part 2: Structures, section 9.13.

type TPMIRHHierarchyAuth = TPMHandle

TPMIRHHierarchyAuth represents a TPMI_RH_HIERARCHY_AUTH. See definition in Part 2: Structures, section 9.15.

type TPMIRHHierarchyPolicy = TPMHandle

TPMIRHHierarchyPolicy represents a TPMI_RH_HIERARCHY_POLICY. See definition in Part 2: Structures, section 9.16.

type TPMIRHLockout = TPMHandle

TPMIRHLockout represents a TPMI_RH_LOCKOUT. See definition in Part 2: Structures, section 9.23.

type TPMIRHNVAuth = TPMHandle

TPMIRHNVAuth represents a TPMI_RH_NV_AUTH. See definition in Part 2: Structures, section 9.22.

type TPMIRHNVIndex = TPMHandle

TPMIRHNVIndex represents a TPMI_RH_NV_INDEX. See definition in Part 2: Structures, section 9.24.

type TPMIRHOwner = TPMHandle

TPMIRHOwner represents a TPMI_RH_OWNER. See definition in Part 2: Structures, section 9.18.

type TPMIRHPlatform = TPMHandle

TPMIRHPlatform represents a TPMI_RH_PLATFORM. See definition in Part 2: Structures, section 9.17.

type TPMIRHProvision = TPMHandle

TPMIRHProvision represents a TPMI_RH_PROVISION. See definition in Part 2: Structures, section 9.20.

type TPMIRSAKeyBits = TPMKeyBits

TPMIRSAKeyBits represents a TPMI_RSA_KEY_BITS. See definition in Part 2: Structures, section 11.2.4.6.

type TPMISHAuthSession = TPMHandle

TPMISHAuthSession represents a TPMI_SH_AUTH_SESSION. See definition in Part 2: Structures, section 9.8.

type TPMISHHMAC = TPMHandle

TPMISHHMAC represents a TPMI_SH_HMAC. See definition in Part 2: Structures, section 9.9.

type TPMISHPolicy = TPMHandle

TPMISHPolicy represents a TPMI_SH_POLICY. See definition in Part 2: Structures, section 9.10.

type TPMISTAttest = TPMST

TPMISTAttest represents a TPMI_ST_ATTEST. See definition in Part 2: Structures, section 10.12.10.

type TPMISTCommandTag added in v0.9.0

type TPMISTCommandTag = TPMST

TPMISTCommandTag represents a TPMI_ST_COMMAND_TAG. See definition in Part 2: Structures, section 9.35.

TPMIYesNo represents a TPMI_YES_NO. See definition in Part 2: Structures, section 9.2. Use native bool for TPMI_YES_NO; encoding/binary already treats this as 8 bits wide.

TPMKeyBits represents a TPM_KEY_BITS. a key size in bits See definition in Part 2, Structures, section 5.3.

TPMKeySize represents a TPM_KEY_SIZE. a key size in octets See definition in Part 2, Structures, section 5.3.

type TPMLACTData struct { ACTData []TPMSACTData gotpm:"list"

}

TPMLACTData represents a TPML_ACT_DATA. See definition in Part 2: Structures, section 10.9.13.

type TPMLAlg struct { Algorithms []TPMAlgID gotpm:"list"

}

TPMLAlg represents a TPML_ALG. See definition in Part 2: Structures, section 10.9.3.

type TPMLAlgProperty struct { AlgProperties []TPMSAlgProperty gotpm:"list"

}

TPMLAlgProperty represents a TPML_ALG_PROPERTY. See definition in Part 2: Structures, section 10.9.8.

type TPMLCC struct { CommandCodes []TPMCC gotpm:"list"

}

TPMLCC represents a TPML_CC. See definition in Part 2: Structures, section 10.9.1.

type TPMLCCA struct { CommandAttributes []TPMACC gotpm:"list"

}

TPMLCCA represents a TPML_CCA. See definition in Part 2: Structures, section 10.9.2.

type TPMLDigest struct {

Digests [][TPM2BDigest](#TPM2BDigest) `gotpm:"list"`

}

TPMLDigest represents a TPML_DIGEST. See definition in Part 2: Structures, section 10.9.5.

type TPMLDigestValues struct {

Digests [][TPMTHA](#TPMTHA) `gotpm:"list"`

}

TPMLDigestValues represents a TPML_DIGEST_VALUES. See definition in Part 2: Structures, section 10.9.6.

type TPMLECCCurve struct { ECCCurves []TPMECCCurve gotpm:"list"

}

TPMLECCCurve represents a TPML_ECC_CURVE. See definition in Part 2: Structures, section 10.9.11.

type TPMLHandle added in v0.9.0

type TPMLHandle struct { Handle []TPMHandle gotpm:"list"

}

TPMLHandle represents a TPML_HANDLE. See definition in Part 2: Structures, section 10.9.4.

type TPMLPCRSelection struct { PCRSelections []TPMSPCRSelection gotpm:"list"

}

TPMLPCRSelection represents a TPML_PCR_SELECTION. See definition in Part 2: Structures, section 10.9.7.

type TPMLTaggedPCRProperty struct { PCRProperty []TPMSTaggedPCRSelect gotpm:"list"

}

TPMLTaggedPCRProperty represents a TPML_TAGGED_PCR_PROPERTY. See definition in Part 2: Structures, section 10.9.10.

type TPMLTaggedPolicy struct { Policies []TPMSTaggedPolicy gotpm:"list"

}

TPMLTaggedPolicy represents a TPML_TAGGED_POLICY. See definition in Part 2: Structures, section 10.9.12.

type TPMLTaggedTPMProperty struct { TPMProperty []TPMSTaggedProperty gotpm:"list"

}

TPMLTaggedTPMProperty represents a TPML_TAGGED_TPM_PROPERTY. See definition in Part 2: Structures, section 10.9.9.

type TPMModifierIndicator uint32

TPMModifierIndicator represents a TPM_MODIFIER_INDICATOR. See definition in Part 2, Structures, section 5.3.

TPMNT represents a TPM_NT. See definition in Part 2: Structures, section 13.4.

const (

TPMNTOrdinary [TPMNT](#TPMNT) = 0x0


TPMNTCounter [TPMNT](#TPMNT) = 0x1


TPMNTBits [TPMNT](#TPMNT) = 0x2


TPMNTExtend [TPMNT](#TPMNT) = 0x4


TPMNTPinFail [TPMNT](#TPMNT) = 0x8


TPMNTPinPass [TPMNT](#TPMNT) = 0x9

)

TPMNT values come from Part 2: Structures, section 13.2.

TPMPT represents a TPM_PT. See definition in Part 2: Structures, section 6.13.

const (

TPMPTFamilyIndicator [TPMPT](#TPMPT) = 0x00000100

TPMPTLevel [TPMPT](#TPMPT) = 0x00000101

TPMPTRevision [TPMPT](#TPMPT) = 0x00000102

TPMPTDayofYear [TPMPT](#TPMPT) = 0x00000103

TPMPTYear [TPMPT](#TPMPT) = 0x00000104

TPMPTManufacturer [TPMPT](#TPMPT) = 0x00000105

TPMPTVendorString1 [TPMPT](#TPMPT) = 0x00000106

TPMPTVendorString2 [TPMPT](#TPMPT) = 0x00000107

TPMPTVendorString3 [TPMPT](#TPMPT) = 0x00000108

TPMPTVendorString4 [TPMPT](#TPMPT) = 0x00000109

TPMPTVendorTPMType [TPMPT](#TPMPT) = 0x0000010A


TPMPTFirmwareVersion1 [TPMPT](#TPMPT) = 0x0000010B


TPMPTFirmwareVersion2 [TPMPT](#TPMPT) = 0x0000010C

TPMPTInputBuffer [TPMPT](#TPMPT) = 0x0000010D

TPMPTHRTransientMin [TPMPT](#TPMPT) = 0x0000010E


TPMPTHRPersistentMin [TPMPT](#TPMPT) = 0x0000010F


TPMPTHRLoadedMin [TPMPT](#TPMPT) = 0x00000110

TPMPTActiveSessionsMax [TPMPT](#TPMPT) = 0x00000111

TPMPTPCRCount [TPMPT](#TPMPT) = 0x00000112

TPMPTPCRSelectMin [TPMPT](#TPMPT) = 0x00000113


TPMPTContextGapMax [TPMPT](#TPMPT) = 0x00000114


TPMPTNVCountersMax [TPMPT](#TPMPT) = 0x00000116

TPMPTNVIndexMax [TPMPT](#TPMPT) = 0x00000117

TPMPTMemory [TPMPT](#TPMPT) = 0x00000118


TPMPTClockUpdate [TPMPT](#TPMPT) = 0x00000119


TPMPTContextHash [TPMPT](#TPMPT) = 0x0000011A

TPMPTContextSym [TPMPT](#TPMPT) = 0x0000011B


TPMPTContextSymSize [TPMPT](#TPMPT) = 0x0000011C

TPMPTOrderlyCount [TPMPT](#TPMPT) = 0x0000011D

TPMPTMaxCommandSize [TPMPT](#TPMPT) = 0x0000011E

TPMPTMaxResponseSize [TPMPT](#TPMPT) = 0x0000011F

TPMPTMaxDigest [TPMPT](#TPMPT) = 0x00000120


TPMPTMaxObjectContext [TPMPT](#TPMPT) = 0x00000121


TPMPTMaxSessionContext [TPMPT](#TPMPT) = 0x00000122

TPMPTPSFamilyIndicator [TPMPT](#TPMPT) = 0x00000123

TPMPTPSLevel [TPMPT](#TPMPT) = 0x00000124

TPMPTPSRevision [TPMPT](#TPMPT) = 0x00000125


TPMPTPSDayOfYear [TPMPT](#TPMPT) = 0x00000126

TPMPTPSYear [TPMPT](#TPMPT) = 0x00000127

TPMPTSplitMax [TPMPT](#TPMPT) = 0x00000128

TPMPTTotalCommands [TPMPT](#TPMPT) = 0x00000129

TPMPTLibraryCommands [TPMPT](#TPMPT) = 0x0000012A

TPMPTVendorCommands [TPMPT](#TPMPT) = 0x0000012B


TPMPTNVBufferMax [TPMPT](#TPMPT) = 0x0000012C


TPMPTModes [TPMPT](#TPMPT) = 0x0000012D


TPMPTMaxCapBuffer [TPMPT](#TPMPT) = 0x0000012E

TPMPTPermanent [TPMPT](#TPMPT) = 0x00000200

TPMPTStartupClear [TPMPT](#TPMPT) = 0x00000201

TPMPTHRNVIndex [TPMPT](#TPMPT) = 0x00000202

TPMPTHRLoaded [TPMPT](#TPMPT) = 0x00000203


TPMPTHRLoadedAvail [TPMPT](#TPMPT) = 0x00000204


TPMPTHRActive [TPMPT](#TPMPT) = 0x00000205


TPMPTHRActiveAvail [TPMPT](#TPMPT) = 0x00000206


TPMPTHRTransientAvail [TPMPT](#TPMPT) = 0x00000207

TPMPTHRPersistent [TPMPT](#TPMPT) = 0x00000208


TPMPTHRPersistentAvail [TPMPT](#TPMPT) = 0x00000209


TPMPTNVCounters [TPMPT](#TPMPT) = 0x0000020A


TPMPTNVCountersAvail [TPMPT](#TPMPT) = 0x0000020B

TPMPTAlgorithmSet [TPMPT](#TPMPT) = 0x0000020C

TPMPTLoadedCurves [TPMPT](#TPMPT) = 0x0000020D

TPMPTLockoutCounter [TPMPT](#TPMPT) = 0x0000020E

TPMPTMaxAuthFail [TPMPT](#TPMPT) = 0x0000020F


TPMPTLockoutInterval [TPMPT](#TPMPT) = 0x00000210


TPMPTLockoutRecovery [TPMPT](#TPMPT) = 0x00000211


TPMPTNVWriteRecovery [TPMPT](#TPMPT) = 0x00000212

TPMPTAuditCounter0 [TPMPT](#TPMPT) = 0x00000213

TPMPTAuditCounter1 [TPMPT](#TPMPT) = 0x00000214

)

TPMPT values come from Part 2: Structures, section 6.13.

TPMPTPCR represents a TPM_PT_PCR. See definition in Part 2: Structures, section 6.14.

const (

TPMPTPCRSave [TPMPTPCR](#TPMPTPCR) = 0x00000000


TPMPTPCRExtendL0 [TPMPTPCR](#TPMPTPCR) = 0x00000001


TPMPTPCRResetL0 [TPMPTPCR](#TPMPTPCR) = 0x00000002


TPMPTPCRExtendL1 [TPMPTPCR](#TPMPTPCR) = 0x00000003


TPMPTPCRResetL1 [TPMPTPCR](#TPMPTPCR) = 0x00000004


TPMPTPCRExtendL2 [TPMPTPCR](#TPMPTPCR) = 0x00000005


TPMPTPCRResetL2 [TPMPTPCR](#TPMPTPCR) = 0x00000006


TPMPTPCRExtendL3 [TPMPTPCR](#TPMPTPCR) = 0x00000007


TPMPTPCRResetL3 [TPMPTPCR](#TPMPTPCR) = 0x00000008


TPMPTPCRExtendL4 [TPMPTPCR](#TPMPTPCR) = 0x00000009


TPMPTPCRResetL4 [TPMPTPCR](#TPMPTPCR) = 0x0000000A


TPMPTPCRNoIncrement [TPMPTPCR](#TPMPTPCR) = 0x00000011


TPMPTPCRDRTMRest [TPMPTPCR](#TPMPTPCR) = 0x00000012


TPMPTPCRPolicy [TPMPTPCR](#TPMPTPCR) = 0x00000013


TPMPTPCRAuth [TPMPTPCR](#TPMPTPCR) = 0x00000014

)

TPMPTPCR values come from Part 2: Structures, section 6.14.

TPMParameterSize represents a TPM_PARAMETER_SIZE. the parameterSize parameter in a command See definition in Part 2, Structures, section 5.3.

TPMRC represents a TPM_RC. See definition in Part 2: Structures, section 6.6.

const ( TPMRCSuccess TPMRC = 0x00000000

TPMRCInitialize      [TPMRC](#TPMRC) = rcVer1 + 0x000
TPMRCFailure         [TPMRC](#TPMRC) = rcVer1 + 0x001
TPMRCSequence        [TPMRC](#TPMRC) = rcVer1 + 0x003
TPMRCPrivate         [TPMRC](#TPMRC) = rcVer1 + 0x00B
TPMRCHMAC            [TPMRC](#TPMRC) = rcVer1 + 0x019
TPMRCDisabled        [TPMRC](#TPMRC) = rcVer1 + 0x020
TPMRCExclusive       [TPMRC](#TPMRC) = rcVer1 + 0x021
TPMRCAuthType        [TPMRC](#TPMRC) = rcVer1 + 0x024
TPMRCAuthMissing     [TPMRC](#TPMRC) = rcVer1 + 0x025
TPMRCPolicy          [TPMRC](#TPMRC) = rcVer1 + 0x026
TPMRCPCR             [TPMRC](#TPMRC) = rcVer1 + 0x027
TPMRCPCRChanged      [TPMRC](#TPMRC) = rcVer1 + 0x028
TPMRCUpgrade         [TPMRC](#TPMRC) = rcVer1 + 0x02D
TPMRCTooManyContexts [TPMRC](#TPMRC) = rcVer1 + 0x02E
TPMRCAuthUnavailable [TPMRC](#TPMRC) = rcVer1 + 0x02F
TPMRCReboot          [TPMRC](#TPMRC) = rcVer1 + 0x030
TPMRCUnbalanced      [TPMRC](#TPMRC) = rcVer1 + 0x031
TPMRCCommandSize     [TPMRC](#TPMRC) = rcVer1 + 0x042
TPMRCCommandCode     [TPMRC](#TPMRC) = rcVer1 + 0x043
TPMRCAuthSize        [TPMRC](#TPMRC) = rcVer1 + 0x044
TPMRCAuthContext     [TPMRC](#TPMRC) = rcVer1 + 0x045
TPMRCNVRange         [TPMRC](#TPMRC) = rcVer1 + 0x046
TPMRCNVSize          [TPMRC](#TPMRC) = rcVer1 + 0x047
TPMRCNVLocked        [TPMRC](#TPMRC) = rcVer1 + 0x048
TPMRCNVAuthorization [TPMRC](#TPMRC) = rcVer1 + 0x049
TPMRCNVUninitialized [TPMRC](#TPMRC) = rcVer1 + 0x04A
TPMRCNVSpace         [TPMRC](#TPMRC) = rcVer1 + 0x04B
TPMRCNVDefined       [TPMRC](#TPMRC) = rcVer1 + 0x04C
TPMRCBadContext      [TPMRC](#TPMRC) = rcVer1 + 0x050
TPMRCCPHash          [TPMRC](#TPMRC) = rcVer1 + 0x051
TPMRCParent          [TPMRC](#TPMRC) = rcVer1 + 0x052
TPMRCNeedsTest       [TPMRC](#TPMRC) = rcVer1 + 0x053
TPMRCNoResult        [TPMRC](#TPMRC) = rcVer1 + 0x054
TPMRCSensitive       [TPMRC](#TPMRC) = rcVer1 + 0x055

TPMRCAsymmetric   [TPMRC](#TPMRC) = rcFmt1 + 0x001
TPMRCAttributes   [TPMRC](#TPMRC) = rcFmt1 + 0x002
TPMRCHash         [TPMRC](#TPMRC) = rcFmt1 + 0x003
TPMRCValue        [TPMRC](#TPMRC) = rcFmt1 + 0x004
TPMRCHierarchy    [TPMRC](#TPMRC) = rcFmt1 + 0x005
TPMRCKeySize      [TPMRC](#TPMRC) = rcFmt1 + 0x007
TPMRCMGF          [TPMRC](#TPMRC) = rcFmt1 + 0x008
TPMRCMode         [TPMRC](#TPMRC) = rcFmt1 + 0x009
TPMRCType         [TPMRC](#TPMRC) = rcFmt1 + 0x00A
TPMRCHandle       [TPMRC](#TPMRC) = rcFmt1 + 0x00B
TPMRCKDF          [TPMRC](#TPMRC) = rcFmt1 + 0x00C
TPMRCRange        [TPMRC](#TPMRC) = rcFmt1 + 0x00D
TPMRCAuthFail     [TPMRC](#TPMRC) = rcFmt1 + 0x00E
TPMRCNonce        [TPMRC](#TPMRC) = rcFmt1 + 0x00F
TPMRCPP           [TPMRC](#TPMRC) = rcFmt1 + 0x010
TPMRCScheme       [TPMRC](#TPMRC) = rcFmt1 + 0x012
TPMRCSize         [TPMRC](#TPMRC) = rcFmt1 + 0x015
TPMRCSymmetric    [TPMRC](#TPMRC) = rcFmt1 + 0x016
TPMRCTag          [TPMRC](#TPMRC) = rcFmt1 + 0x017
TPMRCSelector     [TPMRC](#TPMRC) = rcFmt1 + 0x018
TPMRCInsufficient [TPMRC](#TPMRC) = rcFmt1 + 0x01A
TPMRCSignature    [TPMRC](#TPMRC) = rcFmt1 + 0x01B
TPMRCKey          [TPMRC](#TPMRC) = rcFmt1 + 0x01C
TPMRCPolicyFail   [TPMRC](#TPMRC) = rcFmt1 + 0x01D
TPMRCIntegrity    [TPMRC](#TPMRC) = rcFmt1 + 0x01F
TPMRCTicket       [TPMRC](#TPMRC) = rcFmt1 + 0x020
TPMRCReservedBits [TPMRC](#TPMRC) = rcFmt1 + 0x021
TPMRCBadAuth      [TPMRC](#TPMRC) = rcFmt1 + 0x022
TPMRCExpired      [TPMRC](#TPMRC) = rcFmt1 + 0x023
TPMRCPolicyCC     [TPMRC](#TPMRC) = rcFmt1 + 0x024
TPMRCBinding      [TPMRC](#TPMRC) = rcFmt1 + 0x025
TPMRCCurve        [TPMRC](#TPMRC) = rcFmt1 + 0x026
TPMRCECCPoint     [TPMRC](#TPMRC) = rcFmt1 + 0x027

TPMRCContextGap     [TPMRC](#TPMRC) = rcWarn + 0x001
TPMRCObjectMemory   [TPMRC](#TPMRC) = rcWarn + 0x002
TPMRCSessionMemory  [TPMRC](#TPMRC) = rcWarn + 0x003
TPMRCMemory         [TPMRC](#TPMRC) = rcWarn + 0x004
TPMRCSessionHandles [TPMRC](#TPMRC) = rcWarn + 0x005
TPMRCObjectHandles  [TPMRC](#TPMRC) = rcWarn + 0x006
TPMRCLocality       [TPMRC](#TPMRC) = rcWarn + 0x007
TPMRCYielded        [TPMRC](#TPMRC) = rcWarn + 0x008
TPMRCCanceled       [TPMRC](#TPMRC) = rcWarn + 0x009
TPMRCTesting        [TPMRC](#TPMRC) = rcWarn + 0x00A
TPMRCReferenceH0    [TPMRC](#TPMRC) = rcWarn + 0x010
TPMRCReferenceH1    [TPMRC](#TPMRC) = rcWarn + 0x011
TPMRCReferenceH2    [TPMRC](#TPMRC) = rcWarn + 0x012
TPMRCReferenceH3    [TPMRC](#TPMRC) = rcWarn + 0x013
TPMRCReferenceH4    [TPMRC](#TPMRC) = rcWarn + 0x014
TPMRCReferenceH5    [TPMRC](#TPMRC) = rcWarn + 0x015
TPMRCReferenceH6    [TPMRC](#TPMRC) = rcWarn + 0x016
TPMRCReferenceS0    [TPMRC](#TPMRC) = rcWarn + 0x018
TPMRCReferenceS1    [TPMRC](#TPMRC) = rcWarn + 0x019
TPMRCReferenceS2    [TPMRC](#TPMRC) = rcWarn + 0x01A
TPMRCReferenceS3    [TPMRC](#TPMRC) = rcWarn + 0x01B
TPMRCReferenceS4    [TPMRC](#TPMRC) = rcWarn + 0x01C
TPMRCReferenceS5    [TPMRC](#TPMRC) = rcWarn + 0x01D
TPMRCReferenceS6    [TPMRC](#TPMRC) = rcWarn + 0x01E
TPMRCNVRate         [TPMRC](#TPMRC) = rcWarn + 0x020
TPMRCLockout        [TPMRC](#TPMRC) = rcWarn + 0x021
TPMRCRetry          [TPMRC](#TPMRC) = rcWarn + 0x022
TPMRCNVUnavailable  [TPMRC](#TPMRC) = rcWarn + 0x023

)

TPMRC values come from Part 2: Structures, section 6.6.3.

func (r TPMRC) As(target interface{}) bool

As returns whether the error can be assigned to the given interface type. If supported, it updates the value pointed at by target. Supports the Fmt1Error type.

Error produces a nice human-readable representation of the error, parsing TPM FMT1 errors as needed.

Is returns whether the TPMRC (which may be a FMT1 error) is equal to the given canonical error.

func (r TPMRC) IsWarning() bool

IsWarning returns true if the error is a warning code. This usually indicates a problem with the TPM state, and not the command. Retrying the command later may succeed.

type TPMRspHeader struct {

}

TPMRspHeader is the header structure in front of any TPM response. It is described in Part 1, Architecture.

type TPMSACTData struct {

Handle [TPMHandle](#TPMHandle)

Timeout [uint32](/builtin#uint32)

Attributes [TPMAACT](#TPMAACT)

}

TPMSACTData represents a TPMS_ACT_DATA. See definition in Part 2: Structures, section 10.8.5.

type TPMSAlgProperty struct {

Alg [TPMAlgID](#TPMAlgID)

AlgProperties [TPMAAlgorithm](#TPMAAlgorithm)

}

TPMSAlgProperty represents a TPMS_ALG_PROPERTY. See definition in Part 2: Structures, section 10.8.1.

type TPMSAttest struct {

Magic [TPMGenerated](#TPMGenerated) `gotpm:"check"`

Type [TPMISTAttest](#TPMISTAttest)

QualifiedSigner [TPM2BName](#TPM2BName)
ExtraData [TPM2BData](#TPM2BData)

ClockInfo [TPMSClockInfo](#TPMSClockInfo)

FirmwareVersion [uint64](/builtin#uint64)

Attested [TPMUAttest](#TPMUAttest) `gotpm:"tag=Type"`

}

TPMSAttest represents a TPMS_ATTEST. See definition in Part 2: Structures, section 10.12.12.

type TPMSAuthCommand added in v0.9.0

type TPMSAuthCommand struct { Handle TPMISHAuthSession Nonce TPM2BNonce Attributes TPMASession Authorization TPM2BData

}

TPMSAuthCommand represents a TPMS_AUTH_COMMAND. See definition in Part 2: Structures, section 10.13.2.

type TPMSAuthResponse struct { Nonce TPM2BNonce Attributes TPMASession Authorization TPM2BData

}

TPMSAuthResponse represents a TPMS_AUTH_RESPONSE. See definition in Part 2: Structures, section 10.13.3.

type TPMSCapabilityData struct {

Capability [TPMCap](#TPMCap)

Data [TPMUCapabilities](#TPMUCapabilities) `gotpm:"tag=Capability"`

}

TPMSCapabilityData represents a TPMS_CAPABILITY_DATA. See definition in Part 2: Structures, section 10.10.2.

type TPMSCertifyInfo struct {

Name [TPM2BName](#TPM2BName)

QualifiedName [TPM2BName](#TPM2BName)

}

TPMSCertifyInfo represents a TPMS_CERTIFY_INFO. See definition in Part 2: Structures, section 10.12.3.

TPMSClockInfo represents a TPMS_CLOCK_INFO. See definition in Part 2: Structures, section 10.11.1.

type TPMSCommandAuditInfo added in v0.9.0

type TPMSCommandAuditInfo struct {

AuditCounter [uint64](/builtin#uint64)

DigestAlg [TPMAlgID](#TPMAlgID)

AuditDigest [TPM2BDigest](#TPM2BDigest)

CommandDigest [TPM2BDigest](#TPM2BDigest)

}

TPMSCommandAuditInfo represents a TPMS_COMMAND_AUDIT_INFO. See definition in Part 2: Structures, section 10.12.5.

type TPMSContext struct {

Sequence [uint64](/builtin#uint64)

SavedHandle [TPMIDHSaved](#TPMIDHSaved)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy)

ContextBlob [TPM2BContextData](#TPM2BContextData)

}

TPMSContext represents a TPMS_CONTEXT See definition in Part 2: Structures, section 14.5.

type TPMSContextData struct {

Integrity [TPM2BDigest](#TPM2BDigest)

Encrypted [TPM2BContextSensitive](#TPM2BContextSensitive)

}

TPMSContextData represents a TPMS_CONTEXT_DATA See definition in Part 2: Structures, section 14.3.

type TPMSCreationData struct {

PCRSelect [TPMLPCRSelection](#TPMLPCRSelection)


PCRDigest [TPM2BDigest](#TPM2BDigest)

Locality [TPMALocality](#TPMALocality)

ParentNameAlg [TPMAlgID](#TPMAlgID)

ParentName [TPM2BName](#TPM2BName)

ParentQualifiedName [TPM2BName](#TPM2BName)

OutsideInfo [TPM2BData](#TPM2BData)

}

TPMSCreationData represents a TPMS_CREATION_DATA. See definition in Part 2: Structures, section 15.1.

type TPMSCreationInfo struct {

ObjectName [TPM2BName](#TPM2BName)

CreationHash [TPM2BDigest](#TPM2BDigest)

}

TPMSCreationInfo represents a TPMS_CREATION_INFO. See definition in Part 2: Structures, section 10.12.7.

type TPMSDerive struct { Label TPM2BLabel Context TPM2BLabel

}

TPMSDerive represents a TPMS_DERIVE. See definition in Part 2: Structures, section 11.1.11.

TPMSE represents a TPM_SE. See definition in Part 2: Structures, section 6.11.

const ( TPMSEHMAC TPMSE = 0x00 TPMSEPolicy TPMSE = 0x01 TPMSETrial TPMSE = 0x03 )

TPMSE values come from Part 2: Structures, section 6.11.

type TPMSECCParms struct {

Symmetric [TPMTSymDefObject](#TPMTSymDefObject)


Scheme [TPMTECCScheme](#TPMTECCScheme)

CurveID [TPMIECCCurve](#TPMIECCCurve)


KDF [TPMTKDFScheme](#TPMTKDFScheme)

}

TPMSECCParms represents a TPMS_ECC_PARMS. See definition in Part 2: Structures, section 12.2.3.6.

type TPMSECCPoint struct {

X [TPM2BECCParameter](#TPM2BECCParameter)

Y [TPM2BECCParameter](#TPM2BECCParameter)

}

TPMSECCPoint represents a TPMS_ECC_POINT. See definition in Part 2: Structures, section 11.2.5.2.

type TPMSEmpty struct {

}

TPMSEmpty represents a TPMS_EMPTY. See definition in Part 2: Structures, section 10.1.

type TPMSEncSchemeOAEP TPMSSchemeHash

TPMSEncSchemeOAEP represents a TPMS_ENC_SCHEME_OAEP. See definition in Part 2: Structures, section 11.2.2.2.

type TPMSEncSchemeRSAES TPMSEmpty

TPMSEncSchemeRSAES represents a TPMS_ENC_SCHEME_RSAES. See definition in Part 2: Structures, section 11.2.2.2.

type TPMSKDFSchemeECDH TPMSSchemeHash

TPMSKDFSchemeECDH represents a TPMS_KDF_SCHEME_ECDH. See definition in Part 2: Structures, section 11.2.3.1.

type TPMSKDFSchemeKDF1SP800108 TPMSSchemeHash

TPMSKDFSchemeKDF1SP800108 represents a TPMS_KDF_SCHEME_KDF1SP800108. See definition in Part 2: Structures, section 11.2.3.1.

type TPMSKDFSchemeKDF1SP80056A TPMSSchemeHash

TPMSKDFSchemeKDF1SP80056A represents a TPMS_KDF_SCHEME_KDF1SP80056A. See definition in Part 2: Structures, section 11.2.3.1.

type TPMSKDFSchemeKDF2 TPMSSchemeHash

TPMSKDFSchemeKDF2 represents a TPMS_KDF_SCHEME_KDF2. See definition in Part 2: Structures, section 11.2.3.1.

type TPMSKDFSchemeMGF1 TPMSSchemeHash

TPMSKDFSchemeMGF1 represents a TPMS_KDF_SCHEME_MGF1. See definition in Part 2: Structures, section 11.2.3.1.

type TPMSKeySchemeECDH TPMSSchemeHash

TPMSKeySchemeECDH represents a TPMS_KEY_SCHEME_ECDH. See definition in Part 2: Structures, section 11.2.2.3.

type TPMSKeyedHashParms struct {

Scheme [TPMTKeyedHashScheme](#TPMTKeyedHashScheme)

}

TPMSKeyedHashParms represents a TPMS_KEYEDHASH_PARMS. See definition in Part 2: Structures, section 12.2.3.3.

type TPMSNVCertifyInfo struct {

IndexName [TPM2BName](#TPM2BName)

Offset [uint16](/builtin#uint16)

NVContents [TPM2BData](#TPM2BData)

}

TPMSNVCertifyInfo represents a TPMS_NV_CERTIFY_INFO. See definition in Part 2: Structures, section 10.12.8.

type TPMSNVDigestCertifyInfo struct {

IndexName [TPM2BName](#TPM2BName)

NVDigest [TPM2BDigest](#TPM2BDigest)

}

TPMSNVDigestCertifyInfo represents a TPMS_NV_DIGEST_CERTIFY_INFO. See definition in Part 2: Structures, section 10.12.9.

type TPMSNVPublic struct {

NVIndex [TPMIRHNVIndex](#TPMIRHNVIndex)


NameAlg [TPMIAlgHash](#TPMIAlgHash)

Attributes [TPMANV](#TPMANV)

AuthPolicy [TPM2BDigest](#TPM2BDigest)

DataSize [uint16](/builtin#uint16)

}

TPMSNVPublic represents a TPMS_NV_PUBLIC. See definition in Part 2: Structures, section 13.5.

type TPMSPCRSelection struct { Hash TPMIAlgHash PCRSelect []byte gotpm:"sized8"

}

TPMSPCRSelection represents a TPMS_PCR_SELECTION. See definition in Part 2: Structures, section 10.6.2.

type TPMSQuoteInfo struct {

PCRSelect [TPMLPCRSelection](#TPMLPCRSelection)

PCRDigest [TPM2BDigest](#TPM2BDigest)

}

TPMSQuoteInfo represents a TPMS_QUOTE_INFO. See definition in Part 2: Structures, section 10.12.4.

type TPMSRSAParms struct {

Symmetric [TPMTSymDefObject](#TPMTSymDefObject)


Scheme [TPMTRSAScheme](#TPMTRSAScheme)

KeyBits [TPMIRSAKeyBits](#TPMIRSAKeyBits)


Exponent [uint32](/builtin#uint32)

}

TPMSRSAParms represents a TPMS_RSA_PARMS. See definition in Part 2: Structures, section 12.2.3.5.

type TPMSSchemeECDAA struct {

HashAlg [TPMIAlgHash](#TPMIAlgHash)


Count [uint16](/builtin#uint16)

}

TPMSSchemeECDAA represents a TPMS_SCHEME_ECDAA. See definition in Part 2: Structures, section 11.1.18.

type TPMSSchemeHMAC TPMSSchemeHash

TPMSSchemeHMAC represents a TPMS_SCHEME_HMAC. See definition in Part 2: Structures, section 11.1.20.

type TPMSSchemeHash struct {

HashAlg [TPMIAlgHash](#TPMIAlgHash)

}

TPMSSchemeHash represents a TPMS_SCHEME_HASH. See definition in Part 2: Structures, section 11.1.17.

type TPMSSchemeXOR struct {

HashAlg [TPMIAlgHash](#TPMIAlgHash)

KDF [TPMIAlgKDF](#TPMIAlgKDF)

}

TPMSSchemeXOR represents a TPMS_SCHEME_XOR. See definition in Part 2: Structures, section 11.1.21.

type TPMSSensitiveCreate struct {

UserAuth [TPM2BAuth](#TPM2BAuth)

Data [TPMUSensitiveCreate](#TPMUSensitiveCreate)

}

TPMSSensitiveCreate represents a TPMS_SENSITIVE_CREATE. See definition in Part 2: Structures, section 11.1.15.

type TPMSSessionAuditInfo struct {

ExclusiveSession [TPMIYesNo](#TPMIYesNo)

SessionDigest [TPM2BDigest](#TPM2BDigest)

}

TPMSSessionAuditInfo represents a TPMS_SESSION_AUDIT_INFO. See definition in Part 2: Structures, section 10.12.6.

type TPMSSigSchemeECDSA TPMSSchemeHash

TPMSSigSchemeECDSA represents a TPMS_SIG_SCHEME_ECDSA. See definition in Part 2: Structures, section 11.2.1.3.

type TPMSSigSchemeRSAPSS TPMSSchemeHash

TPMSSigSchemeRSAPSS represents a TPMS_SIG_SCHEME_RSAPSS. See definition in Part 2: Structures, section 11.2.1.2.

type TPMSSigSchemeRSASSA TPMSSchemeHash

TPMSSigSchemeRSASSA represents a TPMS_SIG_SCHEME_RSASSA. See definition in Part 2: Structures, section 11.2.1.2.

type TPMSSignatureECC struct {

Hash       [TPMIAlgHash](#TPMIAlgHash)
SignatureR [TPM2BECCParameter](#TPM2BECCParameter)
SignatureS [TPM2BECCParameter](#TPM2BECCParameter)

}

TPMSSignatureECC represents a TPMS_SIGNATURE_ECC. See definition in Part 2: Structures, section 11.3.2.

type TPMSSignatureRSA struct {

Hash [TPMIAlgHash](#TPMIAlgHash)

Sig [TPM2BPublicKeyRSA](#TPM2BPublicKeyRSA)

}

TPMSSignatureRSA represents a TPMS_SIGNATURE_RSA. See definition in Part 2: Structures, section 11.3.1.

type TPMSSymCipherParms struct {

Sym [TPMTSymDefObject](#TPMTSymDefObject)

}

TPMSSymCipherParms represents a TPMS_SYMCIPHER_PARMS. See definition in Part 2: Structures, section 11.1.9.

TPMST represents a TPM_ST. See definition in Part 2: Structures, section 6.9.

const ( TPMSTRspCommand TPMST = 0x00C4 TPMSTNull TPMST = 0x8000 TPMSTNoSessions TPMST = 0x8001 TPMSTSessions TPMST = 0x8002 TPMSTAttestNV TPMST = 0x8014 TPMSTAttestCommandAudit TPMST = 0x8015 TPMSTAttestSessionAudit TPMST = 0x8016 TPMSTAttestCertify TPMST = 0x8017 TPMSTAttestQuote TPMST = 0x8018 TPMSTAttestTime TPMST = 0x8019 TPMSTAttestCreation TPMST = 0x801A TPMSTAttestNVDigest TPMST = 0x801C TPMSTCreation TPMST = 0x8021 TPMSTVerified TPMST = 0x8022 TPMSTAuthSecret TPMST = 0x8023 TPMSTHashCheck TPMST = 0x8024 TPMSTAuthSigned TPMST = 0x8025 TPMSTFuManifest TPMST = 0x8029 )

TPMST values come from Part 2: Structures, section 6.9.

type TPMSTaggedPCRSelect struct {

Tag [TPMPTPCR](#TPMPTPCR)

PCRSelect [][byte](/builtin#byte) `gotpm:"sized8"`

}

TPMSTaggedPCRSelect represents a TPMS_TAGGED_PCR_SELECT. See definition in Part 2: Structures, section 10.8.3.

type TPMSTaggedPolicy struct {

Handle [TPMHandle](#TPMHandle)

PolicyHash [TPMTHA](#TPMTHA)

}

TPMSTaggedPolicy represents a TPMS_TAGGED_POLICY. See definition in Part 2: Structures, section 10.8.4.

type TPMSTaggedProperty struct {

Property [TPMPT](#TPMPT)

Value [uint32](/builtin#uint32)

}

TPMSTaggedProperty represents a TPMS_TAGGED_PROPERTY. See definition in Part 2: Structures, section 10.8.2.

type TPMSTimeAttestInfo struct {

Time [TPMSTimeInfo](#TPMSTimeInfo)

FirmwareVersion [uint64](/builtin#uint64)

}

TPMSTimeAttestInfo represents a TPMS_TIME_ATTEST_INFO. See definition in Part 2: Structures, section 10.12.2.

type TPMSTimeInfo struct {

Time [uint64](/builtin#uint64)

ClockInfo [TPMSClockInfo](#TPMSClockInfo)

}

TPMSTimeInfo represents a TPMS_TIMEzINFO. See definition in Part 2: Structures, section 10.11.6.

TPMSU represents a TPM_SU. See definition in Part 2: Structures, section 6.10.

const ( TPMSUClear TPMSU = 0x0000 TPMSUState TPMSU = 0x0001 )

TPMSU values come from Part 2: Structures, section 6.10.

type TPMTECCScheme struct {

Scheme [TPMIAlgECCScheme](#TPMIAlgECCScheme) `gotpm:"nullable"`

Details [TPMUAsymScheme](#TPMUAsymScheme) `gotpm:"tag=Scheme"`

}

TPMTECCScheme represents a TPMT_ECC_SCHEME. See definition in Part 2: Structures, section 11.2.5.6.

type TPMTHA struct {

HashAlg [TPMIAlgHash](#TPMIAlgHash) `gotpm:"nullable"`


Digest [][byte](/builtin#byte)

}

TPMTHA represents a TPMT_HA. See definition in Part 2: Structures, section 10.3.2.

type TPMTKDFScheme struct {

Scheme [TPMIAlgKDF](#TPMIAlgKDF) `gotpm:"nullable"`

Details [TPMUKDFScheme](#TPMUKDFScheme) `gotpm:"tag=Scheme"`

}

TPMTKDFScheme represents a TPMT_KDF_SCHEME. See definition in Part 2: Structures, section 11.2.3.3.

type TPMTKeyedHashScheme struct { Scheme TPMIAlgKeyedHashScheme gotpm:"nullable" Details TPMUSchemeKeyedHash gotpm:"tag=Scheme"

}

TPMTKeyedHashScheme represents a TPMT_KEYEDHASH_SCHEME. See definition in Part 2: Structures, section 11.1.23.

type TPMTPublic struct {

Type [TPMIAlgPublic](#TPMIAlgPublic)

NameAlg [TPMIAlgHash](#TPMIAlgHash)


ObjectAttributes [TPMAObject](#TPMAObject)


AuthPolicy [TPM2BDigest](#TPM2BDigest)

Parameters [TPMUPublicParms](#TPMUPublicParms) `gotpm:"tag=Type"`


Unique [TPMUPublicID](#TPMUPublicID) `gotpm:"tag=Type"`

}

TPMTPublic represents a TPMT_PUBLIC. See definition in Part 2: Structures, section 12.2.4.

type TPMTRSAScheme struct {

Scheme [TPMIAlgRSAScheme](#TPMIAlgRSAScheme) `gotpm:"nullable"`

Details [TPMUAsymScheme](#TPMUAsymScheme) `gotpm:"tag=Scheme"`

}

TPMTRSAScheme represents a TPMT_RSA_SCHEME. See definition in Part 2: Structures, section 11.2.4.2.

type TPMTSensitive struct {

SensitiveType [TPMIAlgPublic](#TPMIAlgPublic)

AuthValue [TPM2BAuth](#TPM2BAuth)


SeedValue [TPM2BDigest](#TPM2BDigest)

Sensitive [TPMUSensitiveComposite](#TPMUSensitiveComposite) `gotpm:"tag=SensitiveType"`

}

TPMTSensitive represents a TPMT_SENSITIVE. See definition in Part 2: Structures, section 12.3.2.4.

type TPMTSigScheme struct { Scheme TPMIAlgSigScheme gotpm:"nullable" Details TPMUSigScheme gotpm:"tag=Scheme"

}

TPMTSigScheme represents a TPMT_SIG_SCHEME. See definition in Part 2: Structures, section 11.2.1.5.

type TPMTSignature struct {

SigAlg [TPMIAlgSigScheme](#TPMIAlgSigScheme) `gotpm:"nullable"`

Signature [TPMUSignature](#TPMUSignature) `gotpm:"tag=SigAlg"`

}

TPMTSignature represents a TPMT_SIGNATURE. See definition in Part 2: Structures, section 11.3.4.

type TPMTSymDef struct {

Algorithm [TPMIAlgSym](#TPMIAlgSym) `gotpm:"nullable"`

KeyBits [TPMUSymKeyBits](#TPMUSymKeyBits) `gotpm:"tag=Algorithm"`

Mode [TPMUSymMode](#TPMUSymMode) `gotpm:"tag=Algorithm"`

Details [TPMUSymDetails](#TPMUSymDetails) `gotpm:"tag=Algorithm"`

}

TPMTSymDef represents a TPMT_SYM_DEF. See definition in Part 2: Structures, section 11.1.6.

type TPMTSymDefObject struct {

Algorithm [TPMIAlgSymObject](#TPMIAlgSymObject) `gotpm:"nullable"`

KeyBits [TPMUSymKeyBits](#TPMUSymKeyBits) `gotpm:"tag=Algorithm"`


Mode [TPMUSymMode](#TPMUSymMode) `gotpm:"tag=Algorithm"`

Details [TPMUSymDetails](#TPMUSymDetails) `gotpm:"tag=Algorithm"`

}

TPMTSymDefObject represents a TPMT_SYM_DEF_OBJECT. See definition in Part 2: Structures, section 11.1.7.

type TPMTTKAuth struct {

Tag [TPMST](#TPMST)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy) `gotpm:"nullable"`

Digest [TPM2BDigest](#TPM2BDigest)

}

TPMTTKAuth represents a TPMT_TK_AUTH. See definition in Part 2: Structures, section 10.7.5.

type TPMTTKCreation struct {

Tag [TPMST](#TPMST)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy)

Digest [TPM2BDigest](#TPM2BDigest)

}

TPMTTKCreation represents a TPMT_TK_CREATION. See definition in Part 2: Structures, section 10.7.3.

type TPMTTKHashCheck struct {

Tag [TPMST](#TPMST)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy) `gotpm:"nullable"`

Digest [TPM2BDigest](#TPM2BDigest)

}

TPMTTKHashCheck represents a TPMT_TK_HASHCHECK. See definition in Part 2: Structures, section 10.7.6.

type TPMTTKVerified struct {

Tag [TPMST](#TPMST)

Hierarchy [TPMIRHHierarchy](#TPMIRHHierarchy)

Digest [TPM2BDigest](#TPM2BDigest)

}

TPMTTKVerified represents a TPMT_TK_Verified. See definition in Part 2: Structures, section 10.7.4.

type TPMTTemplate struct {

Type [TPMIAlgPublic](#TPMIAlgPublic)

NameAlg [TPMIAlgHash](#TPMIAlgHash)


ObjectAttributes [TPMAObject](#TPMAObject)


AuthPolicy [TPM2BDigest](#TPM2BDigest)

Parameters [TPMUPublicParms](#TPMUPublicParms) `gotpm:"tag=Type"`

Unique [TPMSDerive](#TPMSDerive)

}

TPMTTemplate represents a TPMT_TEMPLATE. It is not defined in the spec. It represents the alternate form of TPMT_PUBLIC for TPM2B_TEMPLATE as described in Part 2: Structures, 12.2.6.

type TPMUAsymScheme struct {

}

TPMUAsymScheme represents a TPMU_ASYM_SCHEME. See definition in Part 2: Structures, section 11.2.3.5.

func NewTPMUAsymScheme[C AsymSchemeContents](selector TPMAlgID, contents C) TPMUAsymScheme

NewTPMUAsymScheme instantiates a TPMUAsymScheme with the given contents.

ECDAA returns the 'ecdaa' member of the union.

ECDH returns the 'ecdh' member of the union.

ECDSA returns the 'ecdsa' member of the union.

OAEP returns the 'oaep' member of the union.

RSAES returns the 'rsaes' member of the union.

RSAPSS returns the 'rsapss' member of the union.

RSASSA returns the 'rsassa' member of the union.

type TPMUAttest struct {

}

TPMUAttest represents a TPMU_ATTEST. See definition in Part 2: Structures, section 10.12.11.

func NewTPMUAttest[C AttestContents](selector TPMST, contents C) TPMUAttest

NewTPMUAttest instantiates a TPMUAttest with the given contents.

Certify returns the 'certify' member of the union.

func (*TPMUAttest) CommandAudit added in v0.9.0

CommandAudit returns the 'commandAudit' member of the union.

Creation returns the 'creation' member of the union.

NV returns the 'nv' member of the union.

NVDigest returns the 'nvDigest' member of the union.

Quote returns the 'quote' member of the union.

SessionAudit returns the 'sessionAudit' member of the union.

Time returns the 'time' member of the union.

type TPMUCapabilities struct {

}

TPMUCapabilities represents a TPMU_CAPABILITIES. See definition in Part 2: Structures, section 10.10.1.

func NewTPMUCapabilities[C CapabilitiesContents](selector TPMCap, contents C) TPMUCapabilities

NewTPMUCapabilities instantiates a TPMUCapabilities with the given contents.

ACTData returns the 'actData' member of the union.

Algorithms returns the 'algorithms' member of the union.

AssignedPCR returns the 'assignedPCR' member of the union.

func (*TPMUCapabilities) AuditCommands added in v0.9.0

func (u TPMUCapabilities) AuditCommands() (TPMLCC, error)

AuditCommands returns the 'auditCommands' member of the union.

AuthPolicies returns the 'authPolicies' member of the union.

func (*TPMUCapabilities) Command added in v0.9.0

Command returns the 'command' member of the union.

ECCCurves returns the 'eccCurves' member of the union.

func (*TPMUCapabilities) Handles added in v0.9.0

Handles returns the 'handles' member of the union.

PCRProperties returns the 'pcrProperties' member of the union.

func (*TPMUCapabilities) PPCommands added in v0.9.0

PPCommands returns the 'ppCommands' member of the union.

TPMProperties returns the 'tpmProperties' member of the union.

type TPMUKDFScheme struct {

}

TPMUKDFScheme represents a TPMU_KDF_SCHEME. See definition in Part 2: Structures, section 11.2.3.2.

func NewTPMUKDFScheme[C KDFSchemeContents](selector TPMAlgID, contents C) TPMUKDFScheme

NewTPMUKDFScheme instantiates a TPMUKDFScheme with the given contents.

Bits returns the 'bits' member of the union.

ECC returns the 'ecc' member of the union.

ECDH returns the 'ecdh' member of the union.

KDF1SP800108 returns the 'kdf1sp800108' member of the union.

KDF1SP80056A returns the 'kdf1sp80056a' member of the union.

KDF2 returns the 'kdf2' member of the union.

MGF1 returns the 'mgf1' member of the union.

RSA returns the 'rsa' member of the union.

Sym returns the 'sym' member of the union.

type TPMUPublicID struct {

}

TPMUPublicID represents a TPMU_PUBLIC_ID. See definition in Part 2: Structures, section 12.2.3.2.

func NewTPMUPublicID[C PublicIDContents](selector TPMAlgID, contents C) TPMUPublicID

NewTPMUPublicID instantiates a TPMUPublicID with the given contents.

ECC returns the 'ecc' member of the union.

KeyedHash returns the 'keyedHash' member of the union.

RSA returns the 'rsa' member of the union.

SymCipher returns the 'symCipher' member of the union.

type TPMUPublicParms struct {

}

TPMUPublicParms represents a TPMU_PUBLIC_PARMS. See definition in Part 2: Structures, section 12.2.3.7.

func NewTPMUPublicParms[C PublicParmsContents](selector TPMAlgID, contents C) TPMUPublicParms

NewTPMUPublicParms instantiates a TPMUPublicParms with the given contents.

ECCDetail returns the 'eccDetail' member of the union.

KeyedHashDetail returns the 'keyedHashDetail' member of the union.

RSADetail returns the 'rsaDetail' member of the union.

SymDetail returns the 'symDetail' member of the union.

type TPMUSchemeKeyedHash struct {

}

TPMUSchemeKeyedHash represents a TPMU_SCHEME_KEYEDHASH. See definition in Part 2: Structures, section 11.1.22.

func NewTPMUSchemeKeyedHash[C SchemeKeyedHashContents](selector TPMAlgID, contents C) TPMUSchemeKeyedHash

NewTPMUSchemeKeyedHash instantiates a TPMUSchemeKeyedHash with the given contents.

HMAC returns the 'hmac' member of the union.

XOR returns the 'xor' member of the union.

type TPMUSensitiveComposite struct {

}

TPMUSensitiveComposite represents a TPMU_SENSITIVE_COMPOSITE. See definition in Part 2: Structures, section 12.3.2.3.

func NewTPMUSensitiveComposite[C SensitiveCompositeContents](selector TPMAlgID, contents C) TPMUSensitiveComposite

NewTPMUSensitiveComposite instantiates a TPMUSensitiveComposite with the given contents.

type TPMUSensitiveCreate struct {

}

TPMUSensitiveCreate represents a TPMU_SENSITIVE_CREATE. See definition in Part 2: Structures, section 11.1.13.

func NewTPMUSensitiveCreate[C SensitiveCreateContents](contents C) TPMUSensitiveCreate

NewTPMUSensitiveCreate instantiates a TPMUSensitiveCreate with the given contents.

type TPMUSigScheme struct {

}

TPMUSigScheme represents a TPMU_SIG_SCHEME. See definition in Part 2: Structures, section 11.2.1.4.

func NewTPMUSigScheme[C SigSchemeContents](selector TPMAlgID, contents C) TPMUSigScheme

NewTPMUSigScheme instantiates a TPMUSigScheme with the given contents.

ECDAA returns the 'ecdaa' member of the union.

ECDSA returns the 'ecdsa' member of the union.

HMAC returns the 'hmac' member of the union.

RSAPSS returns the 'rsapss' member of the union.

RSASSA returns the 'rsassa' member of the union.

type TPMUSignature struct {

}

TPMUSignature represents a TPMU_SIGNATURE. See definition in Part 2: Structures, section 11.3.3.

func NewTPMUSignature[C SignatureContents](selector TPMAlgID, contents C) TPMUSignature

NewTPMUSignature instantiates a TPMUSignature with the given contents.

ECDAA returns the 'ecdaa' member of the union.

ECDSA returns the 'ecdsa' member of the union.

HMAC returns the 'hmac' member of the union.

RSAPSS returns the 'rsapss' member of the union.

RSASSA returns the 'rsassa' member of the union.

type TPMUSymDetails struct {

}

TPMUSymDetails represents a TPMU_SYM_DETAILS. See definition in Part 2: Structures, section 11.1.5.

type TPMUSymKeyBits struct {

}

TPMUSymKeyBits represents a TPMU_SYM_KEY_BITS. See definition in Part 2: Structures, section 11.1.3.

func NewTPMUSymKeyBits[C SymKeyBitsContents](selector TPMAlgID, contents C) TPMUSymKeyBits

NewTPMUSymKeyBits instantiates a TPMUSymKeyBits with the given contents.

AES returns the 'aes' member of the union.

XOR returns the 'xor' member of the union.

type TPMUSymMode struct {

}

TPMUSymMode represents a TPMU_SYM_MODE. See definition in Part 2: Structures, section 11.1.4.

func NewTPMUSymDetails[C SymDetailsContents](selector TPMAlgID, contents C) TPMUSymMode

NewTPMUSymDetails instantiates a TPMUSymDetails with the given contents.

func NewTPMUSymMode[C SymModeContents](selector TPMAlgID, contents C) TPMUSymMode

NewTPMUSymMode instantiates a TPMUSymMode with the given contents.

AES returns the 'aes' member of the union.

type TemplateContents added in v0.9.0

type TemplateContents interface { Marshallable *TPMTPublic | *TPMTTemplate }

TemplateContents is a type constraint representing the possible contents of TPMUTemplate.

type Unmarshallable interface { Marshallable

}

Unmarshallable represents any TPM type that can be marshalled or unmarshalled.

type Unseal struct { ItemHandle handle gotpm:"handle,auth" }

Unseal is the input to TPM2_Unseal. See definition in Part 3, Commands, section 12.7

func (Unseal) Command added in v0.9.0

func (Unseal) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type UnsealResponse struct { OutData TPM2BSensitiveData }

UnsealResponse is the response from TPM2_Unseal.

type VerifySignature struct {

KeyHandle handle `gotpm:"handle"`

Digest [TPM2BDigest](#TPM2BDigest)

Signature [TPMTSignature](#TPMTSignature)

}

VerifySignature is the input to TPM2_VerifySignature. See definition in Part 3, Commands, section 20.1

func (VerifySignature) Command added in v0.9.0

func (VerifySignature) Command() TPMCC

Command implements the Command interface.

Execute executes the command and returns the response.

type VerifySignatureResponse struct { Validation TPMTTKVerified }

VerifySignatureResponse is the response from TPM2_VerifySignature.