go:generate mockgen -typed -package crypto -destination ./crypto.mock.go . EncryptionAlgorithm
| 17 | //go:generate mockgen -typed -package crypto -destination ./crypto.mock.go . EncryptionAlgorithm |
| 18 | |
| 19 | type EncryptionAlgorithm interface { |
| 20 | Algorithm() string |
| 21 | EncryptionKeyID() string |
| 22 | DecryptionKeyIDs() []string |
| 23 | Encrypt(value []byte) ([]byte, error) |
| 24 | Decrypt(hashed []byte, keyID string) ([]byte, error) |
| 25 | |
| 26 | // DecryptString decrypts the value using the key identified by keyID. |
| 27 | // When the decrypted value contains non-UTF8 characters an error is returned. |
| 28 | DecryptString(hashed []byte, keyID string) (string, error) |
| 29 | } |
| 30 | |
| 31 | // CryptoValue is a struct that can be used to store encrypted values in a database. |
| 32 | // The struct is compatible with the [driver.Valuer] and database/sql.Scanner interfaces. |
no outgoing calls
no test coverage detected