Cipher provides a way to encrypt and decrypt the data key used to encrypt and decrypt sops files, so that the data key can be stored alongside the encrypted content. A Cipher must be able to decrypt the values it encrypts.
| 101 | // Cipher provides a way to encrypt and decrypt the data key used to encrypt and decrypt sops files, so that the |
| 102 | // data key can be stored alongside the encrypted content. A Cipher must be able to decrypt the values it encrypts. |
| 103 | type Cipher interface { |
| 104 | // Encrypt takes a plaintext, a key and additional data and returns the plaintext encrypted with the key, using the |
| 105 | // additional data for authentication |
| 106 | Encrypt(plaintext interface{}, key []byte, additionalData string) (ciphertext string, err error) |
| 107 | // Encrypt takes a ciphertext, a key and additional data and returns the ciphertext encrypted with the key, using |
| 108 | // the additional data for authentication |
| 109 | Decrypt(ciphertext string, key []byte, additionalData string) (plaintext interface{}, err error) |
| 110 | } |
| 111 | |
| 112 | // Comment represents a comment in the sops tree for the file formats that actually support them. |
| 113 | type Comment struct { |
no outgoing calls
no test coverage detected