-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing the decode_encryption_key in the sample code (see below) #9
Comments
There's several ways to approach getting the plaintext key. My assumption here was that it would be generated somewhere else making calls to the KMS service and exist in scope for this example. Upon reflection, that makes things very ambiguous. I'll update this to make things a little more clear, thanks for pointing this out. |
Can you provide an complete example of front-end encrypt/decrypt for upload/download files to S3? |
Do you have the code for the decode_encryption_key(encoded_key)? |
imlocn - just to add some clarity here - the point is that it is NOT the responsibility of boldfield (or this library) to encrypt or decrypt the content that goes into the s3_key + '.key' file. If you want a fast and easy way of doing this with boto3 and KMS: When you encrypt:
Now when you decrypt, this is the bit you need:
|
REGION = 'us-west-2'
BUCKET = 'testing.stuff.bucket'
s3_key = 'testing.txt'
s3 = boto3.client('s3', region_name=REGION)
encoded_key = s3.get_object(Bucket=BUCKET, Key=s3_key + '.key')
plaintext_key = decode_encryption_key(encoded_key)
s3e = S3EncryptionClient(encryption_key=plaintext_key, region_name=REGION)
print s3e.get_object(Bucket=BUCKET, Key=s3_key)
The text was updated successfully, but these errors were encountered: