Documentation ¶
Overview ¶
Package proto contains protocol buffers that are exchanged between the client and server. Note, some of these types have additional helper methods.
Index ¶
- Variables
- type Attestation
- func (*Attestation) Descriptor() ([]byte, []int)deprecated
- func (x *Attestation) GetAkPub() []byte
- func (x *Attestation) GetEventLog() []byte
- func (x *Attestation) GetQuotes() []*Quote
- func (*Attestation) ProtoMessage()
- func (x *Attestation) ProtoReflect() protoreflect.Message
- func (x *Attestation) Reset()
- func (x *Attestation) String() string
- type HashAlgo
- type ImportBlob
- func (*ImportBlob) Descriptor() ([]byte, []int)deprecated
- func (x *ImportBlob) GetDuplicate() []byte
- func (x *ImportBlob) GetEncryptedSeed() []byte
- func (x *ImportBlob) GetPcrs() *Pcrs
- func (x *ImportBlob) GetPublicArea() []byte
- func (*ImportBlob) ProtoMessage()
- func (x *ImportBlob) ProtoReflect() protoreflect.Message
- func (x *ImportBlob) Reset()
- func (x *ImportBlob) String() string
- type ObjectType
- type Pcrs
- func (x *Pcrs) CheckIfSubsetOf(superset *Pcrs) error
- func (x *Pcrs) ComputePCRDigest(hashAlg crypto.Hash) []byte
- func (x *Pcrs) ComputePCRSessionAuth(hashAlg crypto.Hash) []byte
- func (*Pcrs) Descriptor() ([]byte, []int)deprecated
- func (x *Pcrs) GetHash() HashAlgo
- func (x *Pcrs) GetPcrs() map[uint32][]byte
- func (x *Pcrs) HasSamePCRSelection(pcrSel tpm2.PCRSelection) bool
- func (x *Pcrs) PCRSelection() tpm2.PCRSelection
- func (x *Pcrs) PrettyFormat(w io.Writer) error
- func (*Pcrs) ProtoMessage()
- func (x *Pcrs) ProtoReflect() protoreflect.Message
- func (x *Pcrs) Reset()
- func (x *Pcrs) String() string
- type Quote
- func (*Quote) Descriptor() ([]byte, []int)deprecated
- func (x *Quote) GetPcrs() *Pcrs
- func (x *Quote) GetQuote() []byte
- func (x *Quote) GetRawSig() []byte
- func (*Quote) ProtoMessage()
- func (x *Quote) ProtoReflect() protoreflect.Message
- func (x *Quote) Reset()
- func (x *Quote) String() string
- func (x *Quote) Verify(trustedPub crypto.PublicKey, extraData []byte) error
- type SealedBytes
- func (*SealedBytes) Descriptor() ([]byte, []int)deprecated
- func (x *SealedBytes) GetCertifiedPcrs() *Pcrs
- func (x *SealedBytes) GetCreationData() []byte
- func (x *SealedBytes) GetHash() HashAlgo
- func (x *SealedBytes) GetPcrs() []int32
- func (x *SealedBytes) GetPriv() []byte
- func (x *SealedBytes) GetPub() []byte
- func (x *SealedBytes) GetSrk() ObjectType
- func (x *SealedBytes) GetTicket() []byte
- func (*SealedBytes) ProtoMessage()
- func (x *SealedBytes) ProtoReflect() protoreflect.Message
- func (x *SealedBytes) Reset()
- func (x *SealedBytes) String() string
Constants ¶
This section is empty.
Variables ¶
var ( ObjectType_name = map[int32]string{ 0: "OBJECT_INVALID", 1: "RSA", 35: "ECC", } ObjectType_value = map[string]int32{ "OBJECT_INVALID": 0, "RSA": 1, "ECC": 35, } )
Enum value maps for ObjectType.
var ( HashAlgo_name = map[int32]string{ 0: "HASH_INVALID", 4: "SHA1", 11: "SHA256", } HashAlgo_value = map[string]int32{ "HASH_INVALID": 0, "SHA1": 4, "SHA256": 11, } )
Enum value maps for HashAlgo.
var File_proto_tpm_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Attestation ¶
type Attestation struct { AkPub []byte `protobuf:"bytes,1,opt,name=ak_pub,json=akPub,proto3" json:"ak_pub,omitempty"` Quotes []*Quote `protobuf:"bytes,2,rep,name=quotes,proto3" json:"quotes,omitempty"` EventLog []byte `protobuf:"bytes,3,opt,name=event_log,json=eventLog,proto3" json:"event_log,omitempty"` // contains filtered or unexported fields }
func (*Attestation) Descriptor
deprecated
func (*Attestation) Descriptor() ([]byte, []int)
Deprecated: Use Attestation.ProtoReflect.Descriptor instead.
func (*Attestation) GetAkPub ¶
func (x *Attestation) GetAkPub() []byte
func (*Attestation) GetEventLog ¶
func (x *Attestation) GetEventLog() []byte
func (*Attestation) GetQuotes ¶
func (x *Attestation) GetQuotes() []*Quote
func (*Attestation) ProtoMessage ¶
func (*Attestation) ProtoMessage()
func (*Attestation) ProtoReflect ¶
func (x *Attestation) ProtoReflect() protoreflect.Message
func (*Attestation) Reset ¶
func (x *Attestation) Reset()
func (*Attestation) String ¶
func (x *Attestation) String() string
type HashAlgo ¶
type HashAlgo int32
func (HashAlgo) Descriptor ¶ added in v0.2.0
func (HashAlgo) Descriptor() protoreflect.EnumDescriptor
func (HashAlgo) EnumDescriptor
deprecated
func (HashAlgo) Number ¶ added in v0.2.0
func (x HashAlgo) Number() protoreflect.EnumNumber
func (HashAlgo) Type ¶ added in v0.2.0
func (HashAlgo) Type() protoreflect.EnumType
type ImportBlob ¶
type ImportBlob struct { Duplicate []byte `protobuf:"bytes,1,opt,name=duplicate,proto3" json:"duplicate,omitempty"` EncryptedSeed []byte `protobuf:"bytes,2,opt,name=encrypted_seed,json=encryptedSeed,proto3" json:"encrypted_seed,omitempty"` PublicArea []byte `protobuf:"bytes,3,opt,name=public_area,json=publicArea,proto3" json:"public_area,omitempty"` Pcrs *Pcrs `protobuf:"bytes,4,opt,name=pcrs,proto3" json:"pcrs,omitempty"` // contains filtered or unexported fields }
func (*ImportBlob) Descriptor
deprecated
func (*ImportBlob) Descriptor() ([]byte, []int)
Deprecated: Use ImportBlob.ProtoReflect.Descriptor instead.
func (*ImportBlob) GetDuplicate ¶
func (x *ImportBlob) GetDuplicate() []byte
func (*ImportBlob) GetEncryptedSeed ¶
func (x *ImportBlob) GetEncryptedSeed() []byte
func (*ImportBlob) GetPcrs ¶ added in v0.2.0
func (x *ImportBlob) GetPcrs() *Pcrs
func (*ImportBlob) GetPublicArea ¶
func (x *ImportBlob) GetPublicArea() []byte
func (*ImportBlob) ProtoMessage ¶
func (*ImportBlob) ProtoMessage()
func (*ImportBlob) ProtoReflect ¶ added in v0.2.0
func (x *ImportBlob) ProtoReflect() protoreflect.Message
func (*ImportBlob) Reset ¶
func (x *ImportBlob) Reset()
func (*ImportBlob) String ¶
func (x *ImportBlob) String() string
type ObjectType ¶
type ObjectType int32
Enum values come from TCG Algorithm Registry - v1.27 - Table 3
const ( ObjectType_OBJECT_INVALID ObjectType = 0 ObjectType_RSA ObjectType = 1 ObjectType_ECC ObjectType = 35 )
func (ObjectType) Descriptor ¶ added in v0.2.0
func (ObjectType) Descriptor() protoreflect.EnumDescriptor
func (ObjectType) Enum ¶ added in v0.2.0
func (x ObjectType) Enum() *ObjectType
func (ObjectType) EnumDescriptor
deprecated
func (ObjectType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ObjectType.Descriptor instead.
func (ObjectType) Number ¶ added in v0.2.0
func (x ObjectType) Number() protoreflect.EnumNumber
func (ObjectType) String ¶
func (x ObjectType) String() string
func (ObjectType) Type ¶ added in v0.2.0
func (ObjectType) Type() protoreflect.EnumType
type Pcrs ¶ added in v0.1.2
type Pcrs struct { Hash HashAlgo `protobuf:"varint,1,opt,name=hash,proto3,enum=HashAlgo" json:"hash,omitempty"` Pcrs map[uint32][]byte `` /* 150-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Pcrs) CheckIfSubsetOf ¶
CheckIfSubsetOf verifies if the pcrs PCRs are a valid "subset" of the provided "superset" of PCRs. The PCR values must match (if present), and all PCRs must be present in the superset. This function will return an error containing the first missing or mismatched PCR number.
func (*Pcrs) ComputePCRDigest ¶
ComputePCRDigest computes the digest of the Pcrs. Note that the digest hash algorithm may differ from the PCRs' hash (which denotes the PCR bank).
func (*Pcrs) ComputePCRSessionAuth ¶
ComputePCRSessionAuth calculates the authorization value for the given PCRs.
func (*Pcrs) Descriptor
deprecated
added in
v0.1.2
func (*Pcrs) HasSamePCRSelection ¶
func (x *Pcrs) HasSamePCRSelection(pcrSel tpm2.PCRSelection) bool
HasSamePCRSelection checks if the Pcrs has the same PCRSelection as the provided given tpm2.PCRSelection (including the hash algorithm).
func (*Pcrs) PCRSelection ¶
func (x *Pcrs) PCRSelection() tpm2.PCRSelection
PCRSelection returns the corresponding tpm2.PCRSelection for the PCR data.
func (*Pcrs) PrettyFormat ¶
PrettyFormat writes a multiline representation of the PCR values to w.
func (*Pcrs) ProtoMessage ¶ added in v0.1.2
func (*Pcrs) ProtoMessage()
func (*Pcrs) ProtoReflect ¶ added in v0.2.0
func (x *Pcrs) ProtoReflect() protoreflect.Message
type Quote ¶
type Quote struct { Quote []byte `protobuf:"bytes,1,opt,name=quote,proto3" json:"quote,omitempty"` RawSig []byte `protobuf:"bytes,2,opt,name=raw_sig,json=rawSig,proto3" json:"raw_sig,omitempty"` Pcrs *Pcrs `protobuf:"bytes,3,opt,name=pcrs,proto3" json:"pcrs,omitempty"` // contains filtered or unexported fields }
func (*Quote) Descriptor
deprecated
func (*Quote) ProtoMessage ¶
func (*Quote) ProtoMessage()
func (*Quote) ProtoReflect ¶
func (x *Quote) ProtoReflect() protoreflect.Message
func (*Quote) Verify ¶
Verify performs the following checks to validate a Quote:
- the provided signature is generated by the trusted AK public key
- the signature signs the provided quote data
- the quote data starts with TPM_GENERATED_VALUE
- the quote data is a valid TPMS_QUOTE_INFO
- the quote data was taken over the provided PCRs
- the provided PCR values match the quote data internal digest
- the provided extraData matches that in the quote data
Note that the caller must have already established trust in the provided public key before validating the Quote.
Verify supports ECDSA and RSASSA signature verification.
type SealedBytes ¶
type SealedBytes struct { Priv []byte `protobuf:"bytes,1,opt,name=priv,proto3" json:"priv,omitempty"` Pub []byte `protobuf:"bytes,2,opt,name=pub,proto3" json:"pub,omitempty"` Pcrs []int32 `protobuf:"varint,3,rep,packed,name=pcrs,proto3" json:"pcrs,omitempty"` Hash HashAlgo `protobuf:"varint,4,opt,name=hash,proto3,enum=HashAlgo" json:"hash,omitempty"` Srk ObjectType `protobuf:"varint,5,opt,name=srk,proto3,enum=ObjectType" json:"srk,omitempty"` CertifiedPcrs *Pcrs `protobuf:"bytes,6,opt,name=certified_pcrs,json=certifiedPcrs,proto3" json:"certified_pcrs,omitempty"` CreationData []byte `protobuf:"bytes,7,opt,name=creation_data,json=creationData,proto3" json:"creation_data,omitempty"` Ticket []byte `protobuf:"bytes,8,opt,name=ticket,proto3" json:"ticket,omitempty"` // contains filtered or unexported fields }
SealedBytes stores the result of a TPM2_Seal. The private portion (priv) has already been encrypted and is no longer sensitive. The hash algorithm is assumed to be SHA256.
func (*SealedBytes) Descriptor
deprecated
func (*SealedBytes) Descriptor() ([]byte, []int)
Deprecated: Use SealedBytes.ProtoReflect.Descriptor instead.
func (*SealedBytes) GetCertifiedPcrs ¶ added in v0.1.2
func (x *SealedBytes) GetCertifiedPcrs() *Pcrs
func (*SealedBytes) GetCreationData ¶ added in v0.1.2
func (x *SealedBytes) GetCreationData() []byte
func (*SealedBytes) GetHash ¶
func (x *SealedBytes) GetHash() HashAlgo
func (*SealedBytes) GetPcrs ¶
func (x *SealedBytes) GetPcrs() []int32
func (*SealedBytes) GetPriv ¶
func (x *SealedBytes) GetPriv() []byte
func (*SealedBytes) GetPub ¶
func (x *SealedBytes) GetPub() []byte
func (*SealedBytes) GetSrk ¶
func (x *SealedBytes) GetSrk() ObjectType
func (*SealedBytes) GetTicket ¶ added in v0.1.2
func (x *SealedBytes) GetTicket() []byte
func (*SealedBytes) ProtoMessage ¶
func (*SealedBytes) ProtoMessage()
func (*SealedBytes) ProtoReflect ¶ added in v0.2.0
func (x *SealedBytes) ProtoReflect() protoreflect.Message
func (*SealedBytes) Reset ¶
func (x *SealedBytes) Reset()
func (*SealedBytes) String ¶
func (x *SealedBytes) String() string