KeyStore.load() has thrown an IOException

java.io.IOException
Javadoc
Signals that an I/O exception of some sort has occurred. This class is the general class of exceptions produced by failed or interrupted I/O operations. @author unascribed @see java.io.InputStream @see java.io.OutputStream @since JDK1.0
at sun.security.util.DerValue.toDerInputStream
(source)
at sun.security.pkcs12.PKCS12KeyStore.engineLoad
(source)
at java.security.KeyStore.load
(source)

Typical Exception Messages

  1. toDerInputStream rejects tag type 45
  2. toDerInputStream rejects tag type 66
  3. toDerInputStream rejects tag type 77
  4. toDerInputStream rejects tag type -128
  5. toDerInputStream rejects tag type 91
  6. toDerInputStream rejects tag type 123

Origin

PKCS12KeyStore.engineLoad() has thrown an IOException

java.io.IOException
1 frames hidden
sun.security.pkcs12.PKCS12KeyStore.engineLoad
11Web pages

Specific cases

Solution

rafael, 1 year ago

Java Keytool doesn't accept PEM files, you need to convert it to Der before: "openssl x509 -outform der -in certificate.pem -out certificate.der" and to import it to the keystore "keytool -import -alias your-alias -keystore cacerts -file certificate.der"

Check the source of this solution for more info

External results for this pattern (10)

  1. toDerInputStream rejects tag type 45
    Show stack trace
  2. toDerInputStream rejects tag type 45
    Show stack trace
  3. toDerInputStream rejects tag type 45
    Show stack trace
  4. Raymond Holguinvia Coderanch2 years ago
    toDerInputStream rejects tag type 45
    Show stack trace
  5. Unknown authorvia coderanch.com2 years ago
    toDerInputStream rejects tag type 45
    Show stack trace
  6. toDerInputStream rejects tag type 45
    Show stack trace
  7. Denis S.via Stack Overflow3 years ago
    toDerInputStream rejects tag type 66
    Show stack trace
  8. diogogallovia GitHub3 years ago
    toDerInputStream rejects tag type -128
    Show stack trace