Documentation
¶
Index ¶
- type BaseKeyProvider
- type CryptoMaterialsManager
- type DataKey
- type DataKeyI
- type DecryptionHandler
- type DecryptionMaterial
- type DecryptionMaterials
- type DecryptionMaterialsRequest
- type EncryptedDataKey
- type EncryptedDataKeyI
- type EncryptionBuffer
- type EncryptionHandler
- type EncryptionMaterial
- type EncryptionMaterials
- type EncryptionMaterialsRequest
- type KMSClient
- type KMSClientFactory
- type Key
- type KeyBase
- type KeyMeta
- type MasterKey
- type MasterKeyBase
- type MasterKeyFactory
- type MasterKeyProvider
- type ProviderBase
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseKeyProvider ¶
type BaseKeyProvider interface {
ID() string
Kind() types.ProviderKind
VendOnDecrypt() bool
DecryptDataKey(ctx context.Context, MKP MasterKeyProvider, encryptedDataKey EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
DecryptDataKeyFromList(ctx context.Context, MKP MasterKeyProvider, encryptedDataKeys []EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
}
type CryptoMaterialsManager ¶
type CryptoMaterialsManager interface {
GetEncryptionMaterials(ctx context.Context, request EncryptionMaterialsRequest) (EncryptionMaterial, error)
DecryptMaterials(ctx context.Context, request DecryptionMaterialsRequest) (DecryptionMaterial, error)
GetInstance() CryptoMaterialsManager // TODO research and test
}
type DataKey ¶
type DataKey struct {
// contains filtered or unexported fields
}
func NewDataKey ¶
func (DataKey) EncryptedDataKey ¶
func (DataKey) KeyProvider ¶
type DecryptionHandler ¶ added in v0.3.0
type DecryptionMaterial ¶
type DecryptionMaterials ¶
type DecryptionMaterials struct {
// contains filtered or unexported fields
}
func NewDecryptionMaterials ¶
func NewDecryptionMaterials(dataKey DataKeyI, verificationKey []byte) *DecryptionMaterials
func (DecryptionMaterials) DataKey ¶
func (d DecryptionMaterials) DataKey() DataKeyI
func (DecryptionMaterials) VerificationKey ¶
func (d DecryptionMaterials) VerificationKey() []byte
type DecryptionMaterialsRequest ¶
type DecryptionMaterialsRequest struct {
Algorithm *suite.AlgorithmSuite
EncryptedDataKeys []EncryptedDataKeyI
EncryptionContext suite.EncryptionContext
}
type EncryptedDataKey ¶
type EncryptedDataKey struct {
// contains filtered or unexported fields
}
func NewEncryptedDataKey ¶
func NewEncryptedDataKey(provider KeyMeta, encryptedDataKey []byte) *EncryptedDataKey
func (EncryptedDataKey) EncryptedDataKey ¶
func (edk EncryptedDataKey) EncryptedDataKey() []byte
func (EncryptedDataKey) KeyID ¶
func (edk EncryptedDataKey) KeyID() string
func (EncryptedDataKey) KeyProvider ¶
func (edk EncryptedDataKey) KeyProvider() KeyMeta
type EncryptedDataKeyI ¶
type EncryptionBuffer ¶ added in v0.3.0
type EncryptionBuffer interface {
io.ReadWriter
Bytes() []byte
Len() int
Reset()
}
type EncryptionHandler ¶ added in v0.3.0
type EncryptionHandler interface {
Encrypt(ctx context.Context, source []byte, ec suite.EncryptionContext) ([]byte, format.MessageHeader, error)
}
type EncryptionMaterial ¶
type EncryptionMaterial interface {
DataEncryptionKey() DataKeyI
EncryptedDataKeys() []EncryptedDataKeyI
EncryptionContext() suite.EncryptionContext
SigningKey() *ecdsa.PrivateKey
}
type EncryptionMaterials ¶
type EncryptionMaterials struct {
// contains filtered or unexported fields
}
func NewEncryptionMaterials ¶
func NewEncryptionMaterials(dataEncryptionKey DataKeyI, encryptedDataKeys []EncryptedDataKeyI, ec suite.EncryptionContext, signingKey *ecdsa.PrivateKey) *EncryptionMaterials
func (EncryptionMaterials) DataEncryptionKey ¶
func (e EncryptionMaterials) DataEncryptionKey() DataKeyI
func (EncryptionMaterials) EncryptedDataKeys ¶
func (e EncryptionMaterials) EncryptedDataKeys() []EncryptedDataKeyI
func (EncryptionMaterials) EncryptionContext ¶
func (e EncryptionMaterials) EncryptionContext() suite.EncryptionContext
func (EncryptionMaterials) SigningKey ¶
func (e EncryptionMaterials) SigningKey() *ecdsa.PrivateKey
type EncryptionMaterialsRequest ¶
type EncryptionMaterialsRequest struct {
EncryptionContext suite.EncryptionContext
Algorithm *suite.AlgorithmSuite
PlaintextLength int
}
type KMSClient ¶
type KMSClient interface {
GenerateDataKey(ctx context.Context, params *kms.GenerateDataKeyInput, optFns ...func(*kms.Options)) (*kms.GenerateDataKeyOutput, error)
Encrypt(ctx context.Context, params *kms.EncryptInput, optFns ...func(*kms.Options)) (*kms.EncryptOutput, error)
Decrypt(ctx context.Context, params *kms.DecryptInput, optFns ...func(*kms.Options)) (*kms.DecryptOutput, error)
}
type KMSClientFactory ¶
type KeyMeta ¶
func WithKeyMeta ¶
type MasterKey ¶
type MasterKey interface {
MasterKeyBase
GenerateDataKey(ctx context.Context, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
EncryptDataKey(ctx context.Context, dataKey DataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (EncryptedDataKeyI, error)
DecryptDataKey(ctx context.Context, encryptedDataKey EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
}
type MasterKeyBase ¶
type MasterKeyFactory ¶
type MasterKeyProvider ¶
type MasterKeyProvider interface {
ProviderBase
AddMasterKey(keyID string) (MasterKey, error)
NewMasterKey(ctx context.Context, keyID string) (MasterKey, error)
MasterKeysForEncryption(ctx context.Context, ec suite.EncryptionContext) (MasterKey, []MasterKey, error)
MasterKeyForDecrypt(ctx context.Context, metadata KeyMeta) (MasterKey, error)
DecryptDataKey(ctx context.Context, encryptedDataKey EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
DecryptDataKeyFromList(ctx context.Context, encryptedDataKeys []EncryptedDataKeyI, alg *suite.AlgorithmSuite, ec suite.EncryptionContext) (DataKeyI, error)
ValidateMasterKey(keyID string) error
MasterKeysForDecryption() []MasterKey
}
type ProviderBase ¶
type ProviderBase interface {
ProviderKind() types.ProviderKind
ProviderID() string
ValidateProviderID(otherID string) error
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.