kaikramer / keystore-explorer

KeyStore Explorer is a free GUI replacement for the Java command-line utilities keytool and jarsigner.
https://keystore-explorer.org/
GNU General Public License v3.0
1.7k stars 275 forks source link

Error: Illegal object in getInstance #446

Closed Arnieh closed 10 months ago

Arnieh commented 1 year ago

Opening certificates or public keys with EC keys using explicit parameters end in exception When I open a file with either a certificate or na EC public key in it that uses explicit parameters to describe the EC public key, KSE shows an exception: Error Occurred java.lang.IllegalArgumentException: illegal object in getInstance: org.bouncycastle.asn1.DLSequence

This bug is found in KSE 5.5.0, 5.5.1 and 5.5.2, but before in KSE 5.4.4 the bug did not exist and the mentioned EC public keys were read successfully by KSE

To Reproduce An EC public key with named-curve works fine: openssl ecparam -name secp256r1 -param_enc named_curve -genkey -noout -out secp256key-nc.pem openssl ec -in secp256key-nc.pem -pubout -out secp256pub-nc.pem kse secp256pub-nc.pem

An EC public with explicit EC parameters ends in error: openssl ecparam -name secp256r1 -param_enc explicit -genkey -noout -out secp256key-ex.pem openssl ec -in secp256key-ex.pem -pubout -out secp256pub-ex.pem kse secp256pub-nc.pem

Expected behavior The expected behavior is that KSE can open files with explicit EC public key parameters, as it was in KSE 5.4.x

Screenshots Screenshot from KSE 5.5.2 image

Screenshot from KSE 5.4.4 image

Environment

kaikramer commented 1 year ago

Thanks for reporting!

Arnieh commented 1 year ago

Thanks, great work, the latest commit of your code for this issue solved my problem!

kaikramer commented 10 months ago

Closing issues in preparation for release 5.5.3