Input
Output
Input can be:
30 03 02 01 ff (HEX string)
30030201ff (HEX string, without space)
30 03 02 01 FF (HEX string, upper case)
30030201FF (HEX string, without space, upper case)
MAMCAf8= (BASE64/PEM)
Carriage-returns, line-feeds, and tab will be ignored as white space.
Each HEX token must be two digits. I.E. use 03 instead of 3.
20221011-zv: I copied most of this from https://holtstrom.com/michael/tools/asn1decoder.php
and https://holtstrom.com/michael/tools/asciihexconverter.php
a) I mixed both into one single page (more convenient) and added removal of OpenSSL delimiters (-----(BEGIN|END).*?-----) so people can simply paste the whole PEM file in the input,
b) documenting all the OIDs needed to properly interpret any ASN.1 dump in our environment (if there are still unresolved OIDs, the comment points to a likely source of information)
c) implemented some sanity checks regarding the class and P/C parts of the X.690 BER encoding,
d) and modified ASN.1 decoding by adding recursive interpretation of
OCTETSTRINGs and BISTRINGs contents into ASN.1, and ASCII in case of failure.
In case of failure, the initial value is returned; and...
e) added file input and drag and drop to be able to also load non base64 or hex encoded files (pure binary, yadda yadda!).
This avoids going through the pain of doing everything by hand.
NB: the output window is by default 128 characters wide, meaning in hex dumps, like for the public key display, this amounts to 128 nibbles /2 = 64 bytes x8 = 512 bits per line. Counting the length of the keys is therefore pretty easy.
NB2: sometimes readASN1 occurs for a value, which messes up the output. Will look into it later, for in the depths of recursivity, there is no trivial solution...
Useful references:
Examples:
OID:
06092A864886F70D010105
-----BEGIN CERTIFICATE-----
MIINzDCCDLSgAwIBAgIQC1zFgQBsvtbgdrqYZH0UZjANBgkqhkiG9w0BAQsFADBP
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMSkwJwYDVQQDEyBE
aWdpQ2VydCBUTFMgUlNBIFNIQTI1NiAyMDIwIENBMTAeFw0yMjA5MDIwMDAwMDBa
Fw0yMzAyMTAyMzU5NTlaMHYxCzAJBgNVBAYTAkNOMRIwEAYDVQQIDAnmtZnmsZ/n
nIExEjAQBgNVBAcMCeadreW3nuW4gjElMCMGA1UEChMcQWxpYmFiYSBDb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