title: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded
body: <p>I ran the following command to create a JKS file from a PFX file for use in Tomcat:</p>
  
  <pre><code>keytool -importkeystore -srckeystore PFX_P12_FILE_NAME -srcstoretype pkcs12 -srcstorepass PFX_P12_FILE -srcalias SOURCE_ALIAS -destkeystore KEYSTORE_FILE -deststoretype jks -deststorepass PASSWORD -destalias ALIAS_NAME
  </code></pre>
  
  <p>But I am getting the following error:</p>
  
  <blockquote>
    <p>keytool error: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded</p>
  </blockquote>
  
  <p>How is this caused and how can I solve it?</p>