Documentation
¶
Index ¶
- Constants
- Variables
- func AcquireIdentitySRK(tpm transport.TPMCloser, identity *Identity) (*tpm2.AuthHandle, *tpm2.TPMTPublic, error)
- func EncryptFileKey(fileKey []byte, pubkey *ecdh.PublicKey) ([]byte, []byte, error)
- func FlushHandle(tpm transport.TPM, h handle)
- func GetFixedSim() (transport.TPMCloser, error)
- func LoadIdentity(tpm transport.TPMCloser, identity *Identity) (*tpm2.AuthHandle, error)
- func LoadIdentityWithParent(tpm transport.TPMCloser, parent tpm2.AuthHandle, identity *Identity) (*tpm2.AuthHandle, error)
- func MarshalCompressedEC(pk *ecdh.PublicKey) []byte
- func MarshalIdentity(i *Identity, recipient fmt.Stringer, w io.Writer) error
- func MarshalRecipient(recipient fmt.Stringer, w io.Writer) error
- func NewTPM(tpmPath string) (transport.TPMCloser, error)
- func NewTagRecipient(ecc *ecdh.PublicKey) (*tag.Recipient, error)
- func NewTagRecipientFromBytes(s []byte) (*tag.Recipient, error)
- func PublicToECDH(b tpm2.TPM2BPublic) (*ecdh.PublicKey, error)
- func SetLogger(w io.Writer)
- func UnmarshalCompressedEC(b []byte) (*big.Int, *big.Int, *ecdh.PublicKey, error)
- func UnwrapKey(sessionKey, publicKey *ecdh.PublicKey, shared, fileKey []byte) ([]byte, error)
- func WrapKey(sessionKey, publicKey *ecdh.PublicKey, shared, fileKey []byte) ([]byte, error)
- type Identity
- func (i *Identity) Callbacks(plugin *plugin.Plugin, tpm transport.TPMCloser, pin func() ([]byte, error))
- func (i *Identity) HasPIN() bool
- func (i *Identity) Publickey() *ecdh.PublicKey
- func (i *Identity) Recipient() (*tag.Recipient, error)
- func (i *Identity) Serialize() []any
- func (i *Identity) String() string
- func (i *Identity) TPMRecipient() *TPMRecipient
- func (i *Identity) Unwrap(stanzas []*age.Stanza) (fileKey []byte, err error)
- type PINStatus
- type TPMCloser
- type TPMIdentity
- type TPMKeyExchange
- type TPMRecipient
- type TPMTagIdentity
Constants ¶
View Source
const (
PluginName = "tpm"
)
Variables ¶
View Source
var (
Log *log.Logger
)
Functions ¶
func AcquireIdentitySRK ¶ added in v1.0.0
func AcquireIdentitySRK(tpm transport.TPMCloser, identity *Identity) (*tpm2.AuthHandle, *tpm2.TPMTPublic, error)
func EncryptFileKey ¶ added in v0.2.0
Wraps the file key in a session key Returns the sealed filekey, the session pubkey bytes, error
func FlushHandle ¶ added in v0.2.0
Helper to flush handles
func GetFixedSim ¶ added in v0.3.0
func LoadIdentity ¶ added in v0.1.0
func LoadIdentityWithParent ¶ added in v0.1.0
func LoadIdentityWithParent(tpm transport.TPMCloser, parent tpm2.AuthHandle, identity *Identity) (*tpm2.AuthHandle, error)
func MarshalCompressedEC ¶ added in v0.2.0
Marshal a compressed EC key
func NewTagRecipient ¶ added in v1.0.0
func NewTagRecipientFromBytes ¶ added in v1.0.0
func PublicToECDH ¶ added in v1.0.0
func PublicToECDH(b tpm2.TPM2BPublic) (*ecdh.PublicKey, error)
func UnmarshalCompressedEC ¶ added in v0.2.0
Unmarshal a compressed ec key
Types ¶
type Identity ¶ added in v0.1.0
type Identity struct {
Version uint8
PIN PINStatus
Private tpm2.TPM2BPrivate
Public tpm2.TPM2BPublic
SRKName *tpm2.TPM2BName
// contains filtered or unexported fields
}
Identity is the base Identity file for serialziation/deserialization
func CreateIdentity ¶ added in v0.1.0
Creates a new identity. It initializes a new SRK parent in the TPM and returns the identity and the corresponding recipient. Note: It does not load the identity key into the TPM.
func DecodeIdentity ¶ added in v0.1.0
func (*Identity) TPMRecipient ¶ added in v1.0.0
func (i *Identity) TPMRecipient() *TPMRecipient
type TPMCloser ¶ added in v0.3.0
type TPMCloser struct {
// contains filtered or unexported fields
}
TPM represents a connection to a TPM simulator.
type TPMIdentity ¶ added in v1.0.0
type TPMIdentity struct {
// contains filtered or unexported fields
}
TPMIdentity implements the tpm identity handler
func NewTPMIdentity ¶ added in v1.0.0
type TPMKeyExchange ¶ added in v1.0.0
type TPMKeyExchange struct {
// contains filtered or unexported fields
}
func NewTPMKeyExchange ¶ added in v1.0.0
func NewTPMKeyExchange(tpm transport.TPMCloser, pin []byte, i *Identity) *TPMKeyExchange
func (*TPMKeyExchange) Curve ¶ added in v1.0.0
func (t *TPMKeyExchange) Curve() ecdh.Curve
func (*TPMKeyExchange) ECDH ¶ added in v1.0.0
func (t *TPMKeyExchange) ECDH(remoteKey *ecdh.PublicKey) ([]byte, error)
func (*TPMKeyExchange) PublicKey ¶ added in v1.0.0
func (t *TPMKeyExchange) PublicKey() *ecdh.PublicKey
type TPMRecipient ¶ added in v1.0.0
func NewTPMRecipient ¶ added in v1.0.0
func NewTPMRecipient(ecc *ecdh.PublicKey) *TPMRecipient
func ParseTPMRecipient ¶ added in v1.0.0
func ParseTPMRecipient(s string) (*TPMRecipient, error)
func (*TPMRecipient) Bytes ¶ added in v1.0.0
func (r *TPMRecipient) Bytes() []byte
func (*TPMRecipient) String ¶ added in v1.0.0
func (r *TPMRecipient) String() string
func (*TPMRecipient) Tag ¶ added in v1.0.0
func (r *TPMRecipient) Tag() []byte
type TPMTagIdentity ¶ added in v1.0.0
type TPMTagIdentity struct {
// contains filtered or unexported fields
}
TPMTagIdentity implements the p256tag identity handler
func NewTPMTagIdentity ¶ added in v1.0.0
func (*TPMTagIdentity) Recipient ¶ added in v1.0.0
func (t *TPMTagIdentity) Recipient() *tag.Recipient
Click to show internal directories.
Click to hide internal directories.