Documentation
¶
Index ¶
Constants ¶
const SealedDataFname string = "sealed_data"
SealedDataFname contains the file name in which the state is sealed on disk in seal_dir
const SealedKeyFname string = "sealed_key"
SealedKeyFname contains the file name in which the key is sealed with the seal key on disk in seal_dir
Variables ¶
var ErrEncryptionKey = errors.New("cannot unseal encryption key")
ErrEncryptionKey occurs if unsealing the encryption key failed.
Functions ¶
This section is empty.
Types ¶
type AESGCMSealer ¶
type AESGCMSealer struct {
// contains filtered or unexported fields
}
AESGCMSealer implements the Sealer interface using AES-GCM for confidentiallity and authentication
func NewAESGCMSealer ¶
func NewAESGCMSealer(sealDir string) *AESGCMSealer
NewAESGCMSealer creates and initializes a new AESGCMSealer object
func (*AESGCMSealer) Seal ¶
func (s *AESGCMSealer) Seal(unencryptedData []byte, toBeEncrypted []byte) error
Seal encrypts and stores information to the fs
func (*AESGCMSealer) SetEncryptionKey ¶
func (s *AESGCMSealer) SetEncryptionKey(encryptionKey []byte) error
SetEncryptionKey sets or restores an encryption key
type MockSealer ¶
type MockSealer struct {
// mock unseal error
UnsealError error
// contains filtered or unexported fields
}
MockSealer is a mockup sealer
func (*MockSealer) Seal ¶
func (s *MockSealer) Seal(unencryptedData []byte, toBeEncrypted []byte) error
Seal implements the Sealer interface
func (*MockSealer) SetEncryptionKey ¶
func (s *MockSealer) SetEncryptionKey(key []byte) error
SetEncryptionKey implements the Sealer interface
type NoEnclaveSealer ¶
type NoEnclaveSealer struct {
// contains filtered or unexported fields
}
NoEnclaveSealer is a sealed for a -noenclave instance and does perform encryption with a fixed key
func NewNoEnclaveSealer ¶
func NewNoEnclaveSealer(sealDir string) *NoEnclaveSealer
NewNoEnclaveSealer creates and initializes a new NoEnclaveSealer object
func (*NoEnclaveSealer) Seal ¶
func (s *NoEnclaveSealer) Seal(unencryptedData []byte, toBeEncrypted []byte) error
Seal writes the given data encrypted and the used key as plaintext to the disk
func (*NoEnclaveSealer) SetEncryptionKey ¶
func (s *NoEnclaveSealer) SetEncryptionKey(key []byte) error
SetEncryptionKey implements the Sealer interface