title: How to decrypt AWS KMS cipher with AWS Encryption SDK with Java or AWSKmsClient
body: <p>I want to use AWSKmsClient or AWS Encryption SDK with Java to decrypt the message I have encrypted using <code>AWS CLI</code></p>
  
  <p>I have created an encrypted message using:<br>
  <code>aws kms encrypt --key-id 123421-4032-412c-4321-eds42d1a1b432 --plaintext MyText --output text --query CiphertextBlob</code><br>
  It generates something like this for me:
  <code>ADCCAHhJotXoy8910T/Pd8PXVaF/Xkg+9NrF9QTy/XlW7rTtUAH6zACj9MbEY1cS7526GfscAAAAZjBkBgkqhkiG9w0BBwagVzBVAgEAMFAGCSqGSIb3DQEHATAeBglghkgBZDEEAS4wEQQMGmYHb67SV66h/eE0AgEQgCONMNda4kVsSi9sPAXXts2F0N/mwjSlIB2ngJcAyxymnltrHQ==</code></p>
  
  <p>I want to pass this to my scala-spark code and decrypt it either with AWSKmsClient or AWS Encryption SDK with Java.</p>
  
  <p>Based on <a href="https://github.com/aws/aws-encryption-sdk-java/issues/11" rel="nofollow noreferrer">this link</a> it seems there some difference between AWS Encryption SDK and AWS KMS :</p>
  
  <blockquote>
    <p>The AWS Encryption SDK for Java is not meant to be compatible with the
    aws kms command line tool. In short, the AWS Encryption SDK leverages
    KMS to provide more versatile encryption functionality than KMS alone</p>
  </blockquote>
  
  <p>I can not manage to do it with AWSKmsClient either, am I missing something? is there a better way to achieve this?</p>