This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/client" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/kms" | |
"github.com/aws/aws-sdk-go/service/s3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get(bucket, s3_key) | |
client = Aws::S3::Client.new(region: "us-east-1") | |
params = { bucket: bucket, key: s3_key } | |
req = client.build_request(:get_object, params) | |
req.send_request | |
end | |
def decrypt(get_object_output, kms_key_id) | |
cipher_provider = Aws::S3::Encryption::KmsCipherProvider.new(kms_key_id: kms_key_id, kms_client: Aws::KMS::Client.new) | |
envelope = get_object_output.metadata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go ?= go | |
build: fmt lint vet | |
$(go) build ./... | |
fmt: | |
$(go) fmt ./... | |
lint: | |
$(go) get github.com/golang/lint/golint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am magrath on github. | |
* I am magrath (https://keybase.io/magrath) on keybase. | |
* I have a public key whose fingerprint is 4E1E 2273 E7C7 0882 93CE C585 8109 C2B4 373A A79F | |
To claim this, I am signing this object: |