OID Converter

The OID converter is a handy little tool to convert ASN.1 OIDs from readable dotted decimal notation to binary hexadecimal Distinguished Encoding Rules (DER) representation and vice versa. If you're into x.509 certificates, this may be useful to you, too.

Download
The code (a single C file) is here.
A pre-compiled version for Linux is here.
A pre-compiled version for WIN32 is here (currently unavailable due to lack of compiler).
Synopsis
OID encoder/decoder - Matthias Gaertner 1999/2001 - Freeware
Usage:
 OID [-C] [-o<outfile>] {-i<infile>|1.2.3.4}
   converts dotted form to ASCII HEX DER output.
 OID -x [-o<outfile>] {-i<infile>|hex-digits}
   decodes ASCII HEX DER and gives dotted form.
Examples

The OID for rsaSignatureWithripemd160 is 1.3.36.3.3.1.2 (just as an example).

Bug in v1.0

A bug was pointed out to me recently. The original version would not correctly encode OIDs that contain the component 128. Version 1.1 fixes this. As an example, v1.0 would incorrectly encode

>oid 1.3.128
06 02 2B 00
(incorrect!)

while the corrected version will encode this as

>oid 1.3.128
06 03 2B 81 00

(Thanks to Eric Grenier of Cisco for the hint, 24Mar2006)

Related Stuff
Copyright

This code was written by me, Matthias Gärtner. It is freeware. Do with it whatever you want. Use at your own risk. No warranty of any kind.

Back to main page. Back to software page.


 
This page was last changed on March 25th, 2006. © Matthias Gärtner 2001