Documentation
¶
Overview ¶
Package usecase defines business logic interfaces for KEK operations and repository contracts.
Package usecase implements business logic orchestration for cryptographic operations. Coordinates KEK lifecycle including creation, rotation, and decryption using repositories and services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DekRepository ¶ added in v0.12.0
type DekRepository interface {
// Update modifies an existing DEK in the repository.
Update(ctx context.Context, dek *cryptoDomain.Dek) error
// GetBatchNotKekID retrieves a batch of DEKs that are not encrypted with the given KEK ID.
GetBatchNotKekID(ctx context.Context, kekID uuid.UUID, limit int) ([]*cryptoDomain.Dek, error)
}
DekRepository defines persistence operations for Data Encryption Keys. Implementations must support transaction-aware operations via context propagation.
type DekUseCase ¶ added in v0.12.0
type DekUseCase interface {
// Rewrap finds DEKs that are not encrypted with the specified KEK ID,
// decrypts them using their old KEKs, and re-encrypts them with the new KEK.
// Returns the number of DEKs rewrapped in this batch.
Rewrap(
ctx context.Context,
kekChain *cryptoDomain.KekChain,
newKekID uuid.UUID,
batchSize int,
) (int, error)
}
DekUseCase defines business logic operations for Data Encryption Key management.
func NewDekUseCase ¶ added in v0.12.0
func NewDekUseCase( txManager database.TxManager, dekRepo DekRepository, keyManager cryptoService.KeyManager, ) DekUseCase
NewDekUseCase creates a new DekUseCase instance.
type KekRepository ¶
type KekRepository interface {
// Create stores a new KEK in the repository.
Create(ctx context.Context, kek *cryptoDomain.Kek) error
// Update modifies an existing KEK in the repository.
Update(ctx context.Context, kek *cryptoDomain.Kek)