class Aws::S3::Encryption::EncryptHandler

def apply_encryption_envelope(context, envelope, cipher)

def apply_encryption_envelope(context, envelope, cipher)
  context[:encryption][:cipher] = cipher
  if context[:encryption][:envelope_location] == :metadata
    context.params[:metadata] ||= {}
    context.params[:metadata].update(envelope)
  else # :instruction_file
    suffix = context[:encryption][:instruction_file_suffix]
    context.client.put_object(
      bucket: context.params[:bucket],
      key: context.params[:key] + suffix,
      body: Json.dump(envelope)
    )
  end
end