materials

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 9

Documentation

Index

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 (*CachingCryptoMaterialsManager) DecryptMaterials

func (*CachingCryptoMaterialsManager) GetEncryptionMaterials

func (*CachingCryptoMaterialsManager) GetInstance

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 (*DefaultCryptoMaterialsManager) DecryptMaterials

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL