Documentation
¶
Index ¶
Constants ¶
View Source
const ( KeySize128 = 16 KeySize192 = 24 KeySize256 = 32 )
Variables ¶
This section is empty.
Functions ¶
func IsValidKeySize ¶
IsValidKeySize reports whether n is a valid AES key length (128/192/256-bit).
Types ¶
type AESEncryptor ¶
type AESEncryptor struct {
// contains filtered or unexported fields
}
AESEncryptor is the default Encryptor, backed by AES-GCM.
func (AESEncryptor) IsPlainText ¶
func (e AESEncryptor) IsPlainText() bool
type Encryptor ¶
type Encryptor interface {
Encrypt(plaintext []byte) ([]byte, error)
Decrypt(ciphertext []byte) ([]byte, error)
IsPlainText() bool
}
Encryptor abstracts credential encryption so the repository layer never has to know whether it's running with a real key or in plaintext fallback mode.
func NewAESEncryptor ¶
NewAESEncryptor validates key and returns an Encryptor backed by AES-GCM.
type NoOpEncryptor ¶
type NoOpEncryptor struct{}
NoOpEncryptor is a plaintext-passthrough Encryptor, used when no encryption key is configured. It exists so "no key configured" degrades to a visible insecure mode instead of a hard startup failure.
func (NoOpEncryptor) IsPlainText ¶
func (e NoOpEncryptor) IsPlainText() bool
Click to show internal directories.
Click to hide internal directories.