title: How can I call Amazon's AWS kms decrypt function without using a binary file?
body: <p>I have code that retrieves a string that was encrypted using Amazon's aws kms encrypt function.  I would like to call aws kms decrypt to get back the unencrypted value, but I would like to do this without writing the string to a binary file.  All the examples I've found assume you will convert the base64 encoded encrypted value into a binary file using either linux's base64 command or Window's certutil command.  I'm trying to do this on a Windows system.  It seems to me you should be able to run:</p>
  
  <pre><code>aws kms encrypt --key-id &lt;mykey&gt; --plaintext "mysecret"
  </code></pre>
  
  <p>Which for me generates this result:</p>
  
  <pre><code>{
  "KeyId": "arn:aws:kms:us-east-1:192491131326:key/&lt;mykey&gt;",
  "CiphertextBlob": "AQICAHjQ7sViXQdeS4wWbFZpkOQWvCdNXqiy4Cnz0/xEBe39SQGz0vofeAo0+SyOXv172fqkAAAAZjBkBgkqhkiG9w0BBwagVzBVAgEAMFAGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMhchHh0ugGzwRTC4gAgEQgCMlkhYlCYk2SfYIkfQ6ruwA71KBcN7ih/OPzSE86OT/eBOz3Q=="
  }
  </code></pre>
  
  <p>And that I should then be able to run:</p>
  
  <pre><code>aws kms decrypt --ciphertext-blob AQICAHjQ7sViXQdeS4wWbFZpkOQWvCdNXqiy4Cnz0/xEBe39SQGz0vofeAo0+SyOXv172fqkAAAAZjBkBgkqhkiG9w0BBwagVzBVAgEAMFAGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMhchHh0ugGzwRTC4gAgEQgCMlkhYlCYk2SfYIkfQ6ruwA71KBcN7ih/OPzSE86OT/eBOz3Q==
  </code></pre>
  
  <p>To get back the result.  But so far I've been unable to get anything except:</p>
  
  <pre><code>An error occurred (InvalidCiphertextException) when calling the Decrypt operation:
  </code></pre>
  
  <p>Is there some set of parameters I can pass into the decrypt command so that it will decrypt this string?</p>