I’m using the SSL lib 2.2.3 (ej.api).
I want to check a certificate validity. (date)
// Create a CertificateFactory and generate the certificate
certificateFactory = CertificateFactory.getInstance("X509");
localCert = certificateFactory.generateCertificate(certStream);
// Cast to X509Certificate for additional operations
X509Certificate X509_localCert = (X509Certificate) localCert;
// Check certificate validity (throws exception if expired or not yet valid)
X509_localCert.checkValidity(); // Will throw an exception if not valid
// If no exception is thrown, the certificate is valid
System.out.println(certPath + " is valid: Issuer: " + X509_localCert.getIssuerX500Principal());
checkValidity return always this error
java.lang.IllegalStateException: Unexpected error, error code: -1
at java.lang.System.@M:0x1cbde0:0x1cbdea@
at java.lang.Throwable.@M:0x1db9c0:0x1db9d6@
at java.lang.Throwable.@M:0x1c158c:0x1c159e@
at java.lang.Exception.@M:0x1cb85c:0x1cb86e@
at java.lang.RuntimeException.@M:0x1db274:0x1db286@
at java.lang.IllegalStateException.@M:0x1be080:0x1be092@
at com.is2t.support.security.x509.X509CertSupport.@M:0x1b64c8:0x1b6568@
at com.is2t.support.security.x509.X509CertImpl.@M:0x1b9938:0x1b9948@
at com.bodet.terminalw.testsoft.network.NetworkAPI.@M:0x1bfe10:0x1bfec8@
at com.bodet.terminalw.testsoft.network.NetworkAPI.@M:0x1c988c:0x1c98d0@
at com.bodet.terminalw.testsoft.network.NetworkAPI.@M:0x1d6fcc:0x1d7054@
at com.bodet.terminalw.testsoft.main.MainThread.@M:0x1e7458:0x1e7ac0@
at java.lang.Thread.@M:0x1e9f44:0x1e9f50@
at java.lang.Thread.@M:0x1e9fb0:0x1e9fbb@
Is it normal ?