Categories:
Android (13)
Apple Mac (27)
DH Keys (39)
DSA Keys (70)
EC Keys (971)
Firefox (30)
General (10)
Google Chrome (25)
Intermediate CA (152)
Java VM (29)
JDK Keytool (28)
Microsoft CertUtil (29)
Microsoft Edge (9)
Mozilla CertUtil (21)
OpenSSL (236)
Other (7)
Portecle (38)
Publishers (3291)
Revoked Certificates (16)
Root CA (85)
RSA Keys (2635)
Tools (46)
Tutorial (1)
What Is (22)
Windows (127)
Collections:
Other Resources:
OpenSSL "ans1parse -strparse" - Extract ASN.1 Sub Structure
How to how extra an ASN.1 child structure using the OpenSSL "ans1parse" command?
✍: FYIcenter.com
You can use the OpenSSL "ans1parse -strparse offset" command to extract
an ASN.1 child structure from a nested ASN.1 structure.
as shown in the test below:
C:\Users\fyicenter>\local\openssl\openssl.exe OpenSSL> asn1parse -inform DER -in asn1_question.der -i 0:d=0 hl=2 l= 105 cons: SEQUENCE 2:d=1 hl=2 l= 1 prim: INTEGER :05 5:d=1 hl=2 l= 53 prim: IA5STRING :In asymmetric encryption, which key can be given out? 60:d=1 hl=2 l= 45 cons: SEQUENCE 62:d=2 hl=2 l= 14 prim: IA5STRING :A) Private key 78:d=2 hl=2 l= 13 prim: IA5STRING :B) Public key 93:d=2 hl=2 l= 12 prim: IA5STRING :C) Both keys OpenSSL> asn1parse -inform DER -in asn1_question.der -i -strparse 60 0:d=0 hl=2 l= 45 cons: SEQUENCE 2:d=1 hl=2 l= 14 prim: IA5STRING :A) Private key 18:d=1 hl=2 l= 13 prim: IA5STRING :B) Public key 33:d=1 hl=2 l= 12 prim: IA5STRING :C) Both keys OpenSSL> asn1parse -inform DER -in asn1_question.der -i -strparse 60 -noout -out asn1_question_option.der OpenSSL> asn1parse -inform DER -in asn1_question_option.der 0:d=0 hl=2 l= 45 cons: SEQUENCE 2:d=1 hl=2 l= 14 prim: IA5STRING :A) Private key 18:d=1 hl=2 l= 13 prim: IA5STRING :B) Public key 33:d=1 hl=2 l= 12 prim: IA5STRING :C) Both keys OpenSSL> asn1parse -inform DER -in asn1_question_option.der -strparse 33 Error in encoding 12608:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long: .\crypto\asn1\asn1_lib.c:147:
Note about the test:
⇒ OpenSSL "ans1parse" - ASN.1 INTEGER Field Type
⇐ OpenSSL "ans1parse -genconf" - Nested SEQUENCE ASN.1 Structure
2016-09-30, 11212👍, 0💬
Popular Posts:
How to export all certificates in the server certificate path to a file in Firefox? To export all ce...
Certificate summary - Owner: www.squidoo.com, Domain Control Validated - QuickSSL(R) Premium, See ww...
Certificate Summary: Subject: ISRG Root X2 Issuer: ISRG Root X1 Expiration: 2025-09-15 16:00:00 UTC ...
How to create a new keystore file with Portecle? I have Portecle installed. To create a new keystore...
What are CRL (Certificate Revocation List) and OCSP (Online Certificate Status Protocol)? I want to ...