Documentation
¶
Index ¶
- Variables
- type BaseCache
- type CacheEntry
- type CachingCryptoMaterialsManager
- func (c *CachingCryptoMaterialsManager) DecryptMaterials(_ context.Context, _ DecryptionMaterialsRequest) (*DecryptionMaterials, error)
- func (c *CachingCryptoMaterialsManager) GetEncryptionMaterials(_ context.Context, _ EncryptionMaterialsRequest) (*EncryptionMaterials, error)
- func (c *CachingCryptoMaterialsManager) GetInstance() CryptoMaterialsManager
- type CryptoMaterialsManager
- type DecryptionMaterials
- type DecryptionMaterialsRequest
- type DefaultCryptoMaterialsManager
- func (composite *DefaultCryptoMaterialsManager) DecryptMaterials(ctx context.Context, decReq DecryptionMaterialsRequest) (*DecryptionMaterials, error)
- func (composite *DefaultCryptoMaterialsManager) GetEncryptionMaterials(ctx context.Context, encReq EncryptionMaterialsRequest) (*EncryptionMaterials, error)
- func (composite *DefaultCryptoMaterialsManager) GetInstance() CryptoMaterialsManager
- type EncryptionMaterials
- func (e EncryptionMaterials) Algorithm() *suite.AlgorithmSuitedeprecated
- func (e EncryptionMaterials) DataEncryptionKey() keys.DataKeyI
- func (e EncryptionMaterials) EncryptedDataKeys() []keys.EncryptedDataKeyI
- func (e EncryptionMaterials) EncryptionContext() suite.EncryptionContext
- func (e EncryptionMaterials) SigningKey() *ecdsa.PrivateKey
- type EncryptionMaterialsRequest
- type MemoryCache
- func (mc *MemoryCache) GetDecryptionEntry(_ []byte) (*CacheEntry[DecryptionMaterials], error)
- func (mc *MemoryCache) GetEncryptionEntry(_ []byte, _ int) (*CacheEntry[EncryptionMaterials], error)
- func (mc *MemoryCache) PutDecryptionEntry(_ []byte, _ DecryptionMaterials) (*CacheEntry[DecryptionMaterials], error)
- func (mc *MemoryCache) PutEncryptionEntry(_ []byte, _ EncryptionMaterials, _ int) (*CacheEntry[EncryptionMaterials], error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrCMM = errors.New("CMM error")
)
Functions ¶
This section is empty.
Types ¶
type BaseCache ¶
type BaseCache interface {
PutEncryptionEntry(cacheKey []byte, m EncryptionMaterials, n int) (*CacheEntry[EncryptionMaterials], error)
PutDecryptionEntry(cacheKey []byte, m DecryptionMaterials) (*CacheEntry[DecryptionMaterials], error)
GetEncryptionEntry(cacheKey []byte, n int) (*CacheEntry[EncryptionMaterials], error)
GetDecryptionEntry(cacheKey []byte) (*CacheEntry[DecryptionMaterials], error)
}
type CacheEntry ¶
type CacheEntry[V EncryptionMaterials | DecryptionMaterials] struct { // contains filtered or unexported fields }
func NewCacheEntry ¶
func NewCacheEntry[V EncryptionMaterials | DecryptionMaterials](key []byte, value V, lifetime time.Duration) *CacheEntry[V]
func (*CacheEntry[V]) Age ¶
func (ce *CacheEntry[V]) Age() float64
func (*CacheEntry[V]) IsTooOld ¶
func (ce *CacheEntry[V]) IsTooOld() bool
func (*CacheEntry[V]) Key ¶
func (ce *CacheEntry[V]) Key() []byte
func (*CacheEntry[V]) Value ¶
func (ce *CacheEntry[V]) Value() V
type CachingCryptoMaterialsManager ¶
type CachingCryptoMaterialsManager struct {
// contains filtered or unexported fields
}
func NewCaching ¶
func NewCaching(cache BaseCache, _ providers.MasterKeyProvider, _ ...providers.MasterKeyProvider) (*CachingCryptoMaterialsManager, error)
func (*CachingCryptoMaterialsManager) DecryptMaterials ¶
func (c *CachingCryptoMaterialsManager) DecryptMaterials(_ context.Context, _ DecryptionMaterialsRequest) (*DecryptionMaterials, error)
func (*CachingCryptoMaterialsManager) GetEncryptionMaterials ¶
func (c *CachingCryptoMaterialsManager) GetEncryptionMaterials(_ context.Context, _ EncryptionMaterialsRequest) (*EncryptionMaterials, error)
func (*CachingCryptoMaterialsManager) GetInstance ¶
func (c *CachingCryptoMaterialsManager) GetInstance() CryptoMaterialsManager
type CryptoMaterialsManager ¶
type CryptoMaterialsManager interface {
GetEncryptionMaterials(ctx context.Context, request EncryptionMaterialsRequest) (*EncryptionMaterials, error)
DecryptMaterials(ctx context.Context, request DecryptionMaterialsRequest) (*DecryptionMaterials, error)
GetInstance() CryptoMaterialsManager // TODO research and test
}
type DecryptionMaterials ¶
type DecryptionMaterials struct {
// contains filtered or unexported fields
}
DecryptionMaterials Decryption materials returned by CryptoMaterialsManager.DecryptMaterials method
func (DecryptionMaterials) DataKey ¶
func (d DecryptionMaterials) DataKey() keys.DataKeyI
func (DecryptionMaterials) VerificationKey ¶
func (d DecryptionMaterials) VerificationKey() []byte
type DecryptionMaterialsRequest ¶
type DecryptionMaterialsRequest struct {
Algorithm *suite.AlgorithmSuite
EncryptedDataKeys []keys.EncryptedDataKeyI
EncryptionContext suite.EncryptionContext
CommitmentPolicy suite.CommitmentPolicy // TODO andrew remove unused
}
DecryptionMaterialsRequest Request struct to provide to CryptoMaterialsManager.DecryptMaterials method
type DefaultCryptoMaterialsManager ¶
type DefaultCryptoMaterialsManager struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault(primary providers.MasterKeyProvider, extra ...providers.MasterKeyProvider) (*DefaultCryptoMaterialsManager, error)
func (*DefaultCryptoMaterialsManager) DecryptMaterials ¶
func (composite *DefaultCryptoMaterialsManager) DecryptMaterials(ctx context.Context, decReq DecryptionMaterialsRequest) (*DecryptionMaterials, error)
func (*DefaultCryptoMaterialsManager) GetEncryptionMaterials ¶
func (composite *DefaultCryptoMaterialsManager) GetEncryptionMaterials(ctx context.Context, encReq EncryptionMaterialsRequest) (*EncryptionMaterials, error)
func (*DefaultCryptoMaterialsManager) GetInstance ¶
func (composite *DefaultCryptoMaterialsManager) GetInstance() CryptoMaterialsManager
type EncryptionMaterials ¶
type EncryptionMaterials struct {
// contains filtered or unexported fields
}
EncryptionMaterials Encryption materials returned by CryptoMaterialsManager.GetEncryptionMaterials method
func (EncryptionMaterials) Algorithm
deprecated
func (e EncryptionMaterials) Algorithm() *suite.AlgorithmSuite
Algorithm
Deprecated: TODO andrew remove unused
func (EncryptionMaterials) DataEncryptionKey ¶
func (e EncryptionMaterials) DataEncryptionKey() keys.DataKeyI
func (EncryptionMaterials) EncryptedDataKeys ¶
func (e EncryptionMaterials) EncryptedDataKeys() []keys.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
FrameLength int // TODO andrew remove unused
PlaintextRoStream []byte // TODO andrew remove unused
Algorithm *suite.AlgorithmSuite
PlaintextLength int
CommitmentPolicy suite.CommitmentPolicy // TODO andrew remove unused
}
EncryptionMaterialsRequest Request struct to provide to CryptoMaterialsManager.GetEncryptionMaterials method TODO might replace with interface to achieve compatibility in CryptoMaterialsManager interface
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func (*MemoryCache) GetDecryptionEntry ¶
func (mc *MemoryCache) GetDecryptionEntry(_ []byte) (*CacheEntry[DecryptionMaterials], error)
func (*MemoryCache) GetEncryptionEntry ¶
func (mc *MemoryCache) GetEncryptionEntry(_ []byte, _ int) (*CacheEntry[EncryptionMaterials], error)
func (*MemoryCache) PutDecryptionEntry ¶
func (mc *MemoryCache) PutDecryptionEntry(_ []byte, _ DecryptionMaterials) (*CacheEntry[DecryptionMaterials], error)
func (*MemoryCache) PutEncryptionEntry ¶
func (mc *MemoryCache) PutEncryptionEntry(_ []byte, _ EncryptionMaterials, _ int) (*CacheEntry[EncryptionMaterials], error)
Click to show internal directories.
Click to hide internal directories.