title: encryptionsdk.exception.BadCiphertextException: Invalid ciphertext type
body: <p>I am using AWS encryption SDK to encrypt and decrypt files. I am getting an error </p>
  
  <blockquote>
    <p>encryptionsdk.exception.BadCiphertextException: Invalid ciphertext
    type</p>
  </blockquote>
  
  <p>in the following scenario.</p>
  
  <p>I am encrypting my file using command:</p>
  
  <pre><code>aws kms encrypt --key-id keyId --region us-east-1 --plaintext file://text.txt --query CipherTextBlob             --output text | base64 --decode &gt;file.dat.encrypted.
  </code></pre>
  
  <p>I my code I have:</p>
  
  <pre><code>AwsCrypto awsCrypto = new AwsCrypto();
  InputStream inputStream  = new FileInputStream("inputfile");
  final CryptoInputStream decryptingStream = awsCrypto.createDecryptingStream(provider,inputStream);
  OutputStream outputStream = new FileOutputStream("outputFile");
  IOUtils.copy(decryptingStream,outputStream)
  </code></pre>
  
  <p>Could anyone please point out what I am missing in this? I am trying to figure out the problem but I am not able to. Would appreciate any help regarding this.</p>