Using AWS KMS Customer Master Key (CMK), I'm generating a Data Key Pair without plain text. AWS API reference is here. Boto3 API reference for generate_data_key_pair_without_plaintext
is here
I'm using Python2.7 and my code is here
kms = boto3.client('kms')
data_key = kms.generate_data_key_pair_without_plaintext(KeyId=cmk_key_id,
KeyPairSpec='ECC_NIST_P384')
public_key = data_key['PublicKey']
encr_private_key = data_key['PrivateKeyCiphertextBlob']
print("public key: %s" % public_key) <<< prints garbage because public_key is binary object
Documentation says public_key is plaintext (and also Base64-encoded binary data object). This is confusing. Please see this
PublicKey
The public key (in plaintext)
Type: Base64-encoded binary data object
I would like to convert the public key into a PEM format. How can I do that?