Documentation
¶
Overview ¶
Package service provides cryptographic services for AEAD cipher management and key operations. Implements envelope encryption with support for AES-256-GCM and ChaCha20-Poly1305 algorithms.
Package service provides cryptographic services for envelope encryption. Implements AEAD ciphers (AES-256-GCM, ChaCha20-Poly1305) for KEK/DEK management.
Index ¶
- type AEAD
- type AEADManager
- type AEADManagerService
- type AESGCMCipher
- type ChaCha20Poly1305Cipher
- type KMSService
- type KeyManager
- type KeyManagerService
- func (km *KeyManagerService) CreateDek(kek *cryptoDomain.Kek, alg cryptoDomain.Algorithm) (cryptoDomain.Dek, error)
- func (km *KeyManagerService) CreateKek(masterKey *cryptoDomain.MasterKey, alg cryptoDomain.Algorithm) (cryptoDomain.Kek, error)
- func (km *KeyManagerService) DecryptDek(dek *cryptoDomain.Dek, kek *cryptoDomain.Kek) ([]byte, error)
- func (km *KeyManagerService) DecryptKek(kek *cryptoDomain.Kek, masterKey *cryptoDomain.MasterKey) ([]byte, error)
- func (km *KeyManagerService) EncryptDek(dekKey []byte, kek *cryptoDomain.Kek) ([]byte, []byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AEAD ¶
type AEAD interface {
// Encrypt encrypts plaintext with optional AAD and returns ciphertext and nonce.
Encrypt(plaintext, aad []byte) (ciphertext, nonce []byte, err error)
// Decrypt decrypts ciphertext using the provided nonce and AAD.
Decrypt(ciphertext, nonce, aad []byte) ([]byte, error)
// NonceSize returns the size of the nonce required by the cipher.
NonceSize() int
}
AEAD defines the interface for Authenticated Encryption with Associated Data.
type AEADManager ¶
type AEADManager interface {
// CreateCipher creates an AEAD cipher instance for the specified algorithm.
CreateCipher(key []byte, alg cryptoDomain.Algorithm) (AEAD, error)
}
AEADManager defines the interface for creating AEAD cipher instances.
type AEADManagerService ¶
type AEADManagerService struct{}
AEADManagerService implements the AEADManager interface for creating AEAD cipher instances.
func NewAEADManager ¶
func NewAEADManager() *AEADManagerService
NewAEADManager creates a new AEADManagerService.
func (*AEADManagerService) CreateCipher ¶
func (am *AEADManagerService) CreateCipher(key []byte, alg cryptoDomain.Algorithm) (AEAD,