crypto: implement Stringer for S3 and SSEC (#6216)

This commit adds a `fmt.Stringer` implementation for
SSE-S3 and SSE-C. The string representation is the
domain used for object key sealing.
See: `ObjectKey.Seal(...)` and `ObjectKey.Unseal(...)`
This commit is contained in:
Andreas Auernhammer
2018-07-31 20:15:12 +02:00
committed by kannappanr
parent b16e33bcf5
commit a7c9058375
2 changed files with 39 additions and 0 deletions
+8
View File
@@ -65,6 +65,14 @@ const (
InsecureSealAlgorithm = "DARE-SHA256"
)
// String returns the SSE domain as string. For SSE-S3 the
// domain is "SSE-S3".
func (s3) String() string { return "SSE-S3" }
// String returns the SSE domain as string. For SSE-C the
// domain is "SSE-C".
func (ssec) String() string { return "SSE-C" }
// EncryptSinglePart encrypts an io.Reader which must be the
// the body of a single-part PUT request.
func EncryptSinglePart(r io.Reader, key ObjectKey) io.Reader {