OpenSSL "ans1parse" - ASN.1 OCTET STRING Field Type
What is ASN.1 OCTET STRING field type? How to specify OCTET STRING field type in OpenSSL "asn1parse" command?
ASN.1 OCTET STRING field is a primitive field that can be used to store byte strings of any size. To use ASN.1 OCTET STRING field in OpenSSL "asn1parse" command, you need to remember the following rules:
1. ASN.1 OCTET STRING type tag is 0x04.
2. ASN.1 OCTET STRING type code for "asn1parse" command is OCTETSTRING or OCT
3. ASN.1 OCTET STRING value literal can be an ASCII string quoted or not quoted of any size. Double quote (") is reserved as the string quotation. (\") can be used to include (") inside the string. For example, (Hello), ("Hello World!") and ("I heard \"Help!\"") are all valid OCTET STRING values.
4. ASN.1 OCTET STRING value literal can also be a HEX string of any size. To use a HEX string as OCTET STRING value, the field entry must prefix with "FORMAT:HEX," modifier. For example, (FORMAT:HEX,OCTETSTRING:41424344) is a valid OCTET STRING field entry that represents (ABCD) in ASCII format.
5. ASN.1 OCTET STRING value is stored with DER encoding as the value itself. For example, "ABCD" is stored in DER format as 0x41424344.
Here are examples of using BIT STRING with the OpenSSL "asn1parse" command:
C:\Users\fyicenter>\local\openssl\openssl.exe OpenSSL> asn1parse -genstr OCTETSTRING:"ABCD" 0:d=0 hl=2 l= 4 prim: OCTET STRING :ABCD OpenSSL> asn1parse -genstr FORMAT:HEX,OCTETSTRING:41424244 0:d=0 hl=2 l= 4 prim: OCTET STRING :ABBD OpenSSL> asn1parse -genstr FORMAT:HEX,OCTETSTRING:020101 0:d=0 hl=2 l= 3 prim: OCTET STRING [HEX DUMP]:020101
2016-09-28, 5460👍, 0💬
Certificate Summary: Subject: Cybertrust Public SureServer SV CA Issuer: Baltimore CyberTrust Root E...
What options are supported by the "keytool -printcertreq" command? Java Keytool can be used to print...
Certificate Summary: Subject: Class 1 Public Primary Certification Authority - G2, (c) 1998 VeriSign...
How to download Portecle and install it for Windows or Linux? If you want to use Portecle to generat...
How to install OpenSSL on Windows? I have downloaded the "openssl-0.9.8h-1-setup. exe"on the desktop...