MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetEncryptionKey

Method SetEncryptionKey

internal/store/encryption.go:19–21  ·  view source on GitHub ↗

SetEncryptionKey configures the store's AES-256 encryption key for encrypting sensitive fields (e.g., TOTP secrets) at rest. The key must be exactly 32 bytes (256 bits). If empty, encryption is disabled and secrets are stored in plaintext (with a warning logged at startup).

(key []byte)

Source from the content-addressed store, hash-verified

17// The key must be exactly 32 bytes (256 bits). If empty, encryption is disabled
18// and secrets are stored in plaintext (with a warning logged at startup).
19func (s *Store) SetEncryptionKey(key []byte) {
20 s.encryptionKey = key
21}
22
23// HasEncryptionKey reports whether an encryption key is configured.
24func (s *Store) HasEncryptionKey() bool {

Calls

no outgoing calls