I am using an AWS Powershell cmdlet New-KMSDataKey
that creates a System.IO.MemoryStream
that contains an encryption key that I need to use to encrypt some files.
This is the documentation for the command:
http://docs.aws.amazon.com/powershell/latest/reference/items/New-KMSDataKey.html
And this is the object that is returned by that cmdlet:
I am trying to get the plaintext
property. How can I access the System.IO.MemoryStream
to get the key?
This is my script sample:
$KMSKeyS3 = New-KMSDataKey -KeyId $KMSKeySource -KeySpec AES_256 -Region "ap-southeast-2"
This gives me:
CiphertextBlob KeyId Plaintext
-------------- ----- ---------
System.IO.MemoryStream arn:aws:kms:ap-southeast-2:<Customer>:key/<Key> System.IO.MemoryStream