Struct: s3crypto.EncryptionClient

import "../ibm-cos-sdk-go/service/s3/s3crypto"

Overview

EncryptionClient is an S3 crypto client. By default the SDK will use Authentication mode which will use KMS for key wrapping and AES GCM for content encryption. AES GCM will load all data into memory. However, the rest of the content algorithms do not load the entire contents into memory.

Deprecated: This feature is in maintenance mode, no new updates will be released. Please see docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information.

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom

Structure Field Summary collapse

Method Summary collapse

Structure Field Details

ContentCipherBuilder ContentCipherBuilder

MinFileSize int64

MinFileSize is the minimum size for the content to write to a temporary file instead of using memory.

S3Client s3iface.S3API

SaveStrategy SaveStrategy

SaveStrategy will dictate where the envelope is saved.

Defaults to the object's metadata

TempFolderPath string

TempFolderPath is used to store temp files when calling PutObject. Temporary files are needed to compute the X-Amz-Content-Sha256 header.

Method Details

func (c *EncryptionClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error)

PutObject is a wrapper for PutObjectRequest

Deprecated: This feature is in maintenance mode, no new updates will be released. Please see docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information.



117
118
119
120
121
122
// File 'service/s3/s3crypto/encryption_client.go', line 117

func (c *EncryptionClient) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) { if err := validateV1EncryptionClientConstruction(c); err != nil { return nil, err } return putObject(c.getClientOptions(), input) }

func (c *EncryptionClient) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput)

PutObjectRequest creates a temp file to encrypt the contents into. It then streams that data to S3.

Example:

svc := s3crypto.NewEncryptionClient(session.Must(session.NewSession()), s3crypto.AESGCMContentCipherBuilder(handler)) req, out := svc.PutObjectRequest(&s3.PutObjectInput { Key: aws.String("testKey"), Bucket: aws.String("testBucket"), Body: strings.NewReader("test data"), }) err := req.Send()

Deprecated: This feature is in maintenance mode, no new updates will be released. Please see docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information.



94
95
96
97
98
99
100
101
102
103
104
105
106
// File 'service/s3/s3crypto/encryption_client.go', line 94

func (c *EncryptionClient) PutObjectRequest(input *s3.PutObjectInput) (*request.Request, *s3.PutObjectOutput) { req, out := putObjectRequest(c.getClientOptions(), input) if err := validateV1EncryptionClientConstruction(c); err != nil { errHandler := setReqError(err) req.Error = err req.Handlers.Build.Clear() req.Handlers.Send.Clear() req.Handlers.Validate.PushFront(errHandler) req.Handlers.Build.PushFront(errHandler) req.Handlers.Send.PushFront(errHandler) } return req, out }

func (c *EncryptionClient) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error)

PutObjectWithContext is a wrapper for PutObjectRequest with the additional context, and request options support.

PutObjectWithContext is the same as PutObject with the additional support for Context input parameters. The Context must not be nil. A nil Context will cause a panic. Use the Context to add deadlining, timeouts, etc. In the future this may create sub-contexts for individual underlying requests. PutObject is a wrapper for PutObjectRequest

Deprecated: This feature is in maintenance mode, no new updates will be released. Please see docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information.



134
135
136
137
138
139
// File 'service/s3/s3crypto/encryption_client.go', line 134

func (c *EncryptionClient) PutObjectWithContext(ctx aws.Context, input *s3.PutObjectInput, opts ...request.Option) (*s3.PutObjectOutput, error) { if err := validateV1EncryptionClientConstruction(c); err != nil { return nil, err } return putObjectWithContext(c.getClientOptions(), ctx, input, opts...) }