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.67k stars 271 forks source link

Pretty format the hex. serial number in Certificate Details #406

Open bjmi opened 1 year ago

bjmi commented 1 year ago

image It would be useful to have a quick way to get the hexadecimal serial number of a certificate. Therefore I copy the serial 0x9652DF273E8FBBD2CF17DD5A9D56719 from Certificate Details page, add colons, prepend a zero if necessary and lower case the final string manually to get the pretty formatted hexadecimal serial no. 09:65:2d:f2:73:e8:fb:bd:2c:f1:7d:d5:a9:d5:67:19.

It would be great if the serial number field is already formatted. Or one could provide context menu entries Copy as is and Copy formatted.

Companies and public authorities expect the formatted variant in certificate related requests. E.g. OpenSSL prints Serial Number in that way too.

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            09:65:2d:f2:73:e8:fb:bd:2c:f1:7d:d5:a9:d5:67:19
kaikramer commented 1 year ago

I have actually been thinking about this topic quite often in the past few weeks. The problem with hex strings is the multitude of possible formats:

And the format that you prefer is completely useless for me.

KSE is pretty inconsistent in this regard, it currently uses several of the listed formats. I want to unify the hex string representation and add configuration options for it.