java - Error loading KeyStore(PKCS12) -


I want to load a keystore with the load method, but when I use it I got an error What is ICParameter It does not understand.

  try {fileInputStream = new FileInputStream (new file ("D: \\ use \\ key_privateUZ.p12")); Ks = KeyStore.getInstance ("PKCS 12"); Password = "1234" .toCharArray (); Ks.load (is, password); } Hold (exception e) {e.printStackTrace (); }   

My error:

  java.security.cert.CertificateParsingException: java.io.IOException: Only names supported eCParameters sun.security.x509 . Sun.security.x509.X509CertImpl. And lt; Init & gt; (X509CertImpl.java202) at X.Security.x509.X509CertImpl.parse (X509CertImpl.java:1788) on X509CertInfo. & Lt; Init & gt; (X509CertInfo.java:171) sun.security.provider.X509Factory.engineGenerateCertificate (X509Factory.java:97) java.security.cert.CertificateFactory.generateCertificate (CertificateFactory.java:339) on sun.security.pkcs12.PKCS12KeyStore.loadSafeContents (PKCS12KeyStore.java:1441 on java.io :) sun.security.pkcs12.PKCS12KeyStore.engineLoad (PKCS12KeyStore.java:1313) java.security.KeyStore.load (KeyStore.java:1214) Main.main (Main.java: 21) at least because of .IOException: only designated sun.security.ec.ECParameters.decodeParameters on sun.security.ec.ECParameters.engineInit (ECParameters.java:319) on java.security.AlgorithmParameters (ECParameters.java : 202) Supported ECParameters. . sun.security.x509.AlgorithmId.decodeParams (AlgorithmId.java:139) the & init on lt (AlgorithmParameters.java:293) on Sun.security.x509.AlgorithmId; Init & gt; (AlgorithmId.java:114) at sun.security. x509.AlgorithmId.parse (AlgorithmId.java:381) sun.security.x509.X509Key.parse (X509Key.java:168) is sun.security.x509.CertificateX509Key & the lt ;. Init & gt; (CertificateX509Key.java:75) at sun.security.x509.X509CertInfo.parse (X509CertInfo.java:705) at sun.security.x509.X509CertInfo. & Lt; Init & gt; (X509CertInfo.java:169) ... 8 more   

rgers

Wazol

If you do a search specifically, the EC (EC) elliptic curve) parameter.

If you look at the relevant method, you will see a commented section after the exception that indicates:

This is left as the starting point, a complete For parsing implementation

In other words, JDK does not support all possible encodings.

You can use good luck, which is usually more than basic JDK facilities.

This can also help if you explain how the data was generated in the main store.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -