Documentation
¶
Index ¶
- Constants
- Variables
- func CreateIdentity(tpm transport.TPMCloser, pin []byte) (*Identity, *Recipient, error)
- func CreateSRK(tpm transport.TPMCloser) (*tpm2.AuthHandle, *tpm2.TPMTPublic, error)
- func DecryptFileKeyTPM(tpm transport.TPMCloser, identity *Identity, remoteKey, fileKey, pin []byte) ([]byte, error)
- func EncodeIdentity(i *Identity) string
- func EncodeRecipient(recipient *Recipient) string
- func EncryptFileKey(fileKey []byte, pubkey *ecdh.PublicKey) ([]byte, []byte, error)
- func FlushHandle(tpm transport.TPM, h handle)
- func GetFixedSim() (transport.TPMCloser, error)
- func GetPinentry() ([]byte, 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 Marshal(i *Identity, w io.Writer)
- func MarshalCompressedEC(pk *ecdh.PublicKey) []byte
- func MarshalIdentity(i *Identity, recipient *Recipient, w io.Writer) error
- func MarshalRecipient(pubkey *Recipient, w io.Writer) 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
- type PINStatus
- type Recipient
- type TPMCloser
- type TPMDevice
Constants ¶
View Source
const (
PluginName = "tpm"
)
Variables ¶
View Source
var (
ErrPinentryCancelled = errors.New("cancelled pinentry")
)
View Source
var (
Log *log.Logger
)
Functions ¶
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 CreateSRK ¶ added in v0.1.0
func CreateSRK(tpm transport.TPMCloser) (*tpm2.AuthHandle, *tpm2.TPMTPublic, error)
Creates a Storage Key, or return the loaded storage key
func DecryptFileKeyTPM ¶ added in v0.2.0
func DecryptFileKeyTPM(tpm transport.TPMCloser, identity *Identity, remoteKey, fileKey, pin []byte) ([]byte, error)
Decrypts and unwraps a filekey
func EncodeIdentity ¶ added in v0.1.0
func EncodeRecipient ¶
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 GetPinentry ¶ added in v0.2.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 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 }
func DecodeIdentity ¶ added in v0.1.0
type Recipient ¶ added in v0.2.0
func DecodeRecipient ¶
func NewRecipient ¶ added in v0.2.0
func NewRecipientFromBytes ¶ added in v0.2.0
type TPMCloser ¶ added in v0.3.0
type TPMCloser struct {
// contains filtered or unexported fields
}
TPM represents a connection to a TPM simulator.
type TPMDevice ¶ added in v0.1.0
type TPMDevice struct {
// contains filtered or unexported fields
}
Wrap swtpm and tpm into one device thing
func NewTPMDevice ¶ added in v0.1.0
Setup a NewTPMDevice
Click to show internal directories.
Click to hide internal directories.