NewSSEKMS returns a new server-side-encryption using SSE-KMS and the provided Key Id and context.
(keyID string, context interface{})
| 98 | |
| 99 | // NewSSEKMS returns a new server-side-encryption using SSE-KMS and the provided Key Id and context. |
| 100 | func NewSSEKMS(keyID string, context interface{}) (ServerSide, error) { |
| 101 | if context == nil { |
| 102 | return kms{key: keyID, hasContext: false}, nil |
| 103 | } |
| 104 | serializedContext, err := json.Marshal(context) |
| 105 | if err != nil { |
| 106 | return nil, err |
| 107 | } |
| 108 | return kms{key: keyID, context: serializedContext, hasContext: true}, nil |
| 109 | } |
| 110 | |
| 111 | // NewSSEC returns a new server-side-encryption using SSE-C and the provided key. |
| 112 | // The key must be 32 bytes long. |