()
| 60 | } |
| 61 | |
| 62 | func (es *EncryptedString) IsValid() bool { |
| 63 | // cipher.NewGCM() is always used, which panics on a Nonce that is not 12 bytes |
| 64 | // enforce that the nonce length and other values are correct |
| 65 | return es.KeyID != "" && len(es.Data) > 0 && len(es.Nonce) == 12 && es.Algorithm == "aes-gcm-hkdf" |
| 66 | } |
| 67 | |
| 68 | // ShouldReEncrypt tells you if the value encrypted needs to be encrypted again with a newer key. |
| 69 | func (es *EncryptedString) ShouldReEncrypt(encryptionKeyID string) bool { |
no outgoing calls
no test coverage detected