Below you can see output of openssl asn1parse command. The CHOICE
members are encoded using so called context specific tags - which means normal tag value is replaced with the one specified in ASN.1 definition for respective item in the CHOICE
. The tag has value 0 which implicates the first item in CHOICE is selected. The first choice item is of type OCTET STRING
. The value 0 of context specific tag gives you the information about the value type. If there was no context tag, normal OCTET STRING
tag would be used.
0:d=0 hl=2 l= 49 cons: SEQUENCE
2:d=1 hl=2 l= 1 prim: INTEGER :01
5:d=1 hl=2 l= 44 cons: appl [ 0 ]
7:d=2 hl=2 l= 1 prim: INTEGER :03
10:d=2 hl=2 l= 27 prim: OCTET STRING :uid=testuser,dc=test,dc=com
39:d=2 hl=2 l= 10 prim: cont [ 0 ]