Skip to content

Commit

Permalink
Updated KMS Python examples to remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug-AWS committed Aug 17, 2017
1 parent 90e5f5c commit 35cabab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion python/example_code/kms/kms-python-example-decrypt-blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Decrypt blob

blob = '\x01\x02\x02\x00xl\xf0\xbc5_\x1bJ\x14\xb6\xe0\x1e\xcfg.\xb3\x805\r\x02\xd0a\xd2s\xfd\xe8\xe8\x03"T\x17\xb2@\x01\xf2\xb2\xd5iMd%\x84\xca\xdf\xb0\xe1\xa5\x9c\x15O\x00\x00\x00h0f\x06\t*\x86H\x86\xf7\r\x01\x07\x06\xa0Y0W\x02\x01\x000R\x06\t*\x86H\x86\xf7\r\x01\x07\x010\x1e\x06\t`\x86H\x01e\x03\x04\x01.0\x11\x04\x0cU\xfd|\xc8\xd7\xd0\xf9*\x17\x8bF\xbf\x02\x01\x10\x80%"\x92\xda\xbf\xa0\xd0Z\xc9\xa56\xcf\xb8\xed\xc6\xf1.\xae\xd4\x84\xa6[s\x82\xfb\xe8\xe2\xd8\x05u\xf4h\xed\x9eF\xad\xb7\xfc'
blob = '\x01\x02\x02...'

client = boto3.client('kms')

Expand Down
7 changes: 3 additions & 4 deletions python/example_code/kms/kms-python-example-encrypt-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@

import boto3
import base64
import binascii

# Decrypt data
# Encrypt data
#
# Replace the fictitious blob with a valid blob
# Replace the fictitious key ARN with a valid key ID

keyId = 'arn:aws:kms:us-west-2:188580781645:key/cd6b2911-8ed2-4783-87d9-499af9a13af4'
keyId = 'arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab'

text = '1234567890'
text_64 = base64.b64encode(text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,15 @@
# language governing permissions and limitations under the License.

import boto3
import base64
import binascii

# Re-ecrypt data

blob = '\x01\x02\x02\x00xl\xf0\xbc5_\x1bJ\x14\xb6\xe0\x1e\xcfg.\xb3\x805\r\x02\xd0a\xd2s\xfd\xe8\xe8\x03"T\x17\xb2@\x01\xf2\xb2\xd5iMd%\x84\xca\xdf\xb0\xe1\xa5\x9c\x15O\x00\x00\x00h0f\x06\t*\x86H\x86\xf7\r\x01\x07\x06\xa0Y0W\x02\x01\x000R\x06\t*\x86H\x86\xf7\r\x01\x07\x010\x1e\x06\t`\x86H\x01e\x03\x04\x01.0\x11\x04\x0cU\xfd|\xc8\xd7\xd0\xf9*\x17\x8bF\xbf\x02\x01\x10\x80%"\x92\xda\xbf\xa0\xd0Z\xc9\xa56\xcf\xb8\xed\xc6\xf1.\xae\xd4\x84\xa6[s\x82\xfb\xe8\xe2\xd8\x05u\xf4h\xed\x9eF\xad\xb7\xfc'
blob = '\x01\x02\x02\...'

# Replace the fictitious key ARN with a valid key ID

destinationKeyId = 'arn:aws:kms:us-west-2:111122223333:key/0987dcba-09fe-87dc-65ba-ab0987654321'

# DELETE BEFORE PUBLISHING
destinationKeyId = 'arn:aws:kms:us-west-2:188580781645:key/cd6b2911-8ed2-4783-87d9-499af9a13af4'

client = boto3.client('kms')

response = client.re_encrypt(
Expand Down

0 comments on commit 35cabab

Please sign in to comment.