Struct: s3crypto.HeaderV2SaveStrategy

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

Overview

Save will save the envelope to the request's header.

Implemented Interfaces

s3crypto.Cipher, s3manager.ReadSeekerWriteTo, s3crypto.SaveStrategy, s3manager.WriterReadFrom

Method Summary collapse

Method Details

func (strat HeaderV2SaveStrategy) Save(env Envelope, req *request.Request) error



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// File 'service/s3/s3crypto/strategy.go', line 54

func (strat HeaderV2SaveStrategy) Save(env Envelope, req *request.Request) error { input := req.Params.(*s3.PutObjectInput) if input.Metadata == nil { input.Metadata = map[string]*string{} } input.Metadata[http.CanonicalHeaderKey(keyV2Header)] = &env.CipherKey input.Metadata[http.CanonicalHeaderKey(ivHeader)] = &env.IV input.Metadata[http.CanonicalHeaderKey(matDescHeader)] = &env.MatDesc input.Metadata[http.CanonicalHeaderKey(wrapAlgorithmHeader)] = &env.WrapAlg input.Metadata[http.CanonicalHeaderKey(cekAlgorithmHeader)] = &env.CEKAlg input.Metadata[http.CanonicalHeaderKey(unencryptedContentLengthHeader)] = &env.UnencryptedContentLen if len(env.TagLen) > 0 { input.Metadata[http.CanonicalHeaderKey(tagLengthHeader)] = &env.TagLen } return nil }