OpenSSL "ans1parse" - ASN.1 OBJECT IDENTIFIER Field Type

Q

What is ASN.1 OBJECT IDENTIFIER field type? How to specify OBJECT IDENTIFIER field type in OpenSSL "asn1parse" command?

✍: FYIcenter.com

A

ASN.1 OBJECT IDENTIFIER field is a primitive field that can be used to store an Object Identifier (OID) defined in the ASN.1 standard. An OID has 3 equivalent values: short name, long name and numerical format. For example, "CN", "commonName", and "2.5.4.3" are the same OID to identify the common name of the subject in a certificate.

To use ASN.1 OBJECT IDENTIFIER field in OpenSSL "asn1parse" command, you need to remember the following rules:

  • ASN.1 OBJECT IDENTIFIER type tag is 0x06.
  • ASN.1 OBJECT IDENTIFIER type code for "asn1parse" command is OBJECT or OID.
  • ASN.1 OBJECT IDENTIFIER value literal can be short name, long name or numerical format. For example, "CN", "commonName", and "2.5.4.3" are all valid OBJECT IDENTIFIER values.
  • ASN.1 OBJECT IDENTIFIER value is stored with DER encoding using the ASN.1 standard based on the numerical format, See the DER Encoding of ASN.1 Types - OBJECT IDENTIFIER artical from Microsoft for more details.

Here are examples of using IA5STRING with the OpenSSL "asn1parse" command:

C:\Users\fyicenter>\local\openssl\openssl.exe

OpenSSL> asn1parse -genstr OBJECT:CN
    0:d=0  hl=2 l=   3 prim: OBJECT            :commonName

OpenSSL> asn1parse -genstr OBJECT:commonName
    0:d=0  hl=2 l=   3 prim: OBJECT            :commonName

OpenSSL> asn1parse -genstr OBJECT:2.5.4.3
    0:d=0  hl=2 l=   3 prim: OBJECT            :commonName

 

OpenSSL "ans1parse" - ASN.1 BIT STRING Field Type

OpenSSL "ans1parse" - ASN.1 IA5STRING Field Type

OpenSSL "ans1parse" Command

⇑⇑ OpenSSL Tutorials

2016-09-30, 8714👍, 0💬