Closed nathalials closed 7 years ago
readCertPEM seems to have some bug. Please try following:
hCert = ASN1HEX.pemToHex(pemCertString);
pubkey = X509.getPublicKeyFromHex(hCert);
keylen = pubkey.n.bitLength(); // for RSA public key
readCertPEM can't read X509v1 certificate such like your certificate and read only RSA public key certificate. I'll fix this in the next version.
Ok. It worked for public key, thanks!
Now ... how can I get other certificate information? (since readCertPEM has a bug, methods like x509.getSubjectString
, x509.getNotAfter
, getNotBefore
is not working - on this certificate pem above)
Yes, they are needed to X509v1 certificate support. Please wait future update.
For now, it's not possible to parse any information of this certificate?
X509v1 means version 1?
Yes, you are right. It's a v1 certificate.
Do you have any idea when it will support X509v1?
I hope v1 supprt update will be released in a few days.
I've released 7.1.4 which supports fields for X509v1 certificate today.
wow, that was fast! thank you very much!
Hey, I'm trying to parse information of a PEM certificate file and I'm having some issues.
This is the certificate content:
It's possible to parse and check all certificate information in terminal, including the public key.
This is the code to get public key information:
But the library is returning me this error (when I run the code above):
Uncaught malformed X.509 certificate PEM (code:003)
Would you mind help me understand why this occurs, please?