1package s3crypto 2 3import "io" 4 5// ContentCipherBuilder is a builder interface that builds 6// ciphers for each request. 7type ContentCipherBuilder interface { 8 ContentCipher() (ContentCipher, error) 9} 10 11// ContentCipher deals with encrypting and decrypting content 12type ContentCipher interface { 13 EncryptContents(io.Reader) (io.Reader, error) 14 DecryptContents(io.ReadCloser) (io.ReadCloser, error) 15 GetCipherData() CipherData 16} 17 18// CipherData is used for content encryption. It is used for storing the 19// metadata of the encrypted content. 20type CipherData struct { 21 Key []byte 22 IV []byte 23 WrapAlgorithm string 24 CEKAlgorithm string 25 TagLength string 26 MaterialDescription MaterialDescription 27 // EncryptedKey should be populated when calling GenerateCipherData 28 EncryptedKey []byte 29 30 Padder Padder 31} 32