mirror of
https://github.com/minio/minio.git
synced 2024-12-26 07:05:55 -05:00
b87fae0049
This change moves away from a unified constructor for plaintext and encrypted usage. NewPutObjReader is simplified for the plain-text reader use. For encrypted reader use, WithEncryption should be called on an initialized PutObjReader. Plaintext: func NewPutObjReader(rawReader *hash.Reader) *PutObjReader The hash.Reader is used to provide payload size and md5sum to the downstream consumers. This is different from the previous version in that there is no need to pass nil values for unused parameters. Encrypted: func WithEncryption(encReader *hash.Reader, key *crypto.ObjectKey) (*PutObjReader, error) This method sets up encrypted reader along with the key to seal the md5sum produced by the plain-text reader (already setup when NewPutObjReader was called). Usage: ``` pReader := NewPutObjReader(rawReader) // ... other object handler code goes here // Prepare the encrypted hashed reader pReader, err = pReader.WithEncryption(encReader, objEncKey) ``` |
||
---|---|---|
.. | ||
gateway-s3_test.go | ||
gateway-s3-metadata_test.go | ||
gateway-s3-metadata.go | ||
gateway-s3-sse.go | ||
gateway-s3-utils.go | ||
gateway-s3.go |