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)
| 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). |
| 19 | func (s *Store) SetEncryptionKey(key []byte) { |
| 20 | s.encryptionKey = key |
| 21 | } |
| 22 | |
| 23 | // HasEncryptionKey reports whether an encryption key is configured. |
| 24 | func (s *Store) HasEncryptionKey() bool { |
no outgoing calls