Documentation ¶
Index ¶
- Constants
- func WithEncryptingPublicKey(with string) wrapping.Option
- func WithPCRS(with string) wrapping.Option
- func WithPCRValues(with string) wrapping.Option
- func WithTPMPath(with string) wrapping.Option
- func WithUserAgent(with string) wrapping.Option
- type OptionFunc
- type RemoteWrapper
- func (s *RemoteWrapper) Decrypt(ctx context.Context, in *wrapping.BlobInfo, opt ...wrapping.Option) ([]byte, error)
- func (s *RemoteWrapper) Encrypt(ctx context.Context, plaintext []byte, opt ...wrapping.Option) (*wrapping.BlobInfo, error)
- func (s *RemoteWrapper) KeyId(_ context.Context) (string, error)
- func (s *RemoteWrapper) SetConfig(_ context.Context, opt ...wrapping.Option) (*wrapping.WrapperConfig, error)
- func (s *RemoteWrapper) Type(_ context.Context) (wrapping.WrapperType, error)
- type Wrapper
- func (s *Wrapper) Decrypt(ctx context.Context, in *wrapping.BlobInfo, opt ...wrapping.Option) ([]byte, error)
- func (s *Wrapper) Encrypt(ctx context.Context, plaintext []byte, opt ...wrapping.Option) (*wrapping.BlobInfo, error)
- func (s *Wrapper) KeyId(_ context.Context) (string, error)
- func (s *Wrapper) SetConfig(_ context.Context, opt ...wrapping.Option) (*wrapping.WrapperConfig, error)
- func (s *Wrapper) Type(_ context.Context) (wrapping.WrapperType, error)
Constants ¶
const ( EnvTPMPath = "TPM_PATH" EnvPCRS = "TPM_PCRS" EnvPCRValues = "TPM_PCR_VALUES" EnvEncryptingPublicKey = "TPM_ENCRYPTING_PUBLIC_KEY" )
const ( TPMSeal = iota TPMImport )
const (
WrapperTypeRemoteTPM wrapping.WrapperType = "tpmimport"
)
const (
WrapperTypeTPM wrapping.WrapperType = "tpm"
)
Variables ¶
This section is empty.
Functions ¶
func WithEncryptingPublicKey ¶ added in v0.1.0
Encrypted public key Multiple PCR values are comma separated (.WithPCRValues("hex_encoded_string"))
func WithPCRS ¶
List of PCR banks to bind the key against. Multiple PCR values are comma separated (.WithPCRS("16,23"))
func WithPCRValues ¶ added in v0.1.0
List of PCR Value Multiple PCR values are comma separated (.WithPCRValues("0:123abc,7:abcae"))
func WithUserAgent ¶
WithUserAgent provides a way to chose the user agent
Types ¶
type OptionFunc ¶
type OptionFunc func(*options) error
OptionFunc holds a function with local options
type RemoteWrapper ¶ added in v0.1.0
type RemoteWrapper struct {
// contains filtered or unexported fields
}
Configures and manages the TPM SRK encryption wrapper
Values here are set using setConfig or options
func NewRemoteWrapper ¶ added in v0.1.0
func NewRemoteWrapper() *RemoteWrapper
Initialize a TPM based encryption wrapper
func (*RemoteWrapper) Decrypt ¶ added in v0.1.0
func (s *RemoteWrapper) Decrypt(ctx context.Context, in *wrapping.BlobInfo, opt ...wrapping.Option) ([]byte, error)
Decrypt is used to decrypt the ciphertext.
func (*RemoteWrapper) Encrypt ¶ added in v0.1.0
func (s *RemoteWrapper) Encrypt(ctx context.Context, plaintext []byte, opt ...wrapping.Option) (*wrapping.BlobInfo, error)
Encrypts data using a TPM's Storage Root Key (SRK)
func (*RemoteWrapper) KeyId ¶ added in v0.1.0
func (s *RemoteWrapper) KeyId(_ context.Context) (string, error)
func (*RemoteWrapper) SetConfig ¶ added in v0.1.0
func (s *RemoteWrapper) SetConfig(_ context.Context, opt ...wrapping.Option) (*wrapping.WrapperConfig, error)
Set the configuration options
func (*RemoteWrapper) Type ¶ added in v0.1.0
func (s *RemoteWrapper) Type(_ context.Context) (wrapping.WrapperType, error)
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Configures and manages the TPM SRK encryption wrapper
Values here are set using setConfig or options
func (*Wrapper) Decrypt ¶
func (s *Wrapper) Decrypt(ctx context.Context, in *wrapping.BlobInfo, opt ...wrapping.Option) ([]byte, error)
Decrypt is used to decrypt the ciphertext.
func (*Wrapper) Encrypt ¶
func (s *Wrapper) Encrypt(ctx context.Context, plaintext []byte, opt ...wrapping.Option) (*wrapping.BlobInfo, error)
Encrypts data using a TPM's Storage Root Key (SRK)