OpenSSL "ans1parse" - Configuration File for DSA Public Key

Q

Can I build a DSA public key from an OpenSSL configuration file?

✍: FYIcenter.com

A

Yes, you can build a DSA public key from an OpenSSL configuration file, if you know the components of the key, as shown in the test below:

C:\Users\fyicenter>type asn1_dsa_pub_key.cnf
asn1 = SEQUENCE:dsa_pub_key

[dsa_pub_key]
algorithm  =SEQUENCE:dsa_alg
public     =BITWRAP,INTEGER:0x424A04378703B51FAD65CEC2C59BF6FA2CD40AA64C\
43975B564004519798E5B2FCC74D4DE407B73812341ABBCE0878CD2CA23A4501992E6384\
2531BCAA7A9702

[dsa_alg]
algorithm =OID:dsaEncryption
parameter =SEQUENCE:dsa_param

[dsa_param]
p      =INTEGER:0xB2A22FE456DD10930CEED27DE2E58E69E27CB52E14BE655C5D0F4E\
DC4A627A800A211DABD9B07D974EF3C997DD198E31C2B238696CBF5E9984B1EE3D11B2D9E3
q      =INTEGER:0xA17145E13E0034692FC1BD85BDF88E1AA578818D
g      =INTEGER:0x79F4E4FB123458BFDD388E0CC90D776C3CBB9C82E10668C71318D3\
22AF5968EE8FB9F64F9AC09A9AAA24AD8DED795B7CE4BB81E02047AAC4D3E95513AA8FD5DD

C:\Users\fyicenter>\local\openssl\openssl 
   asn1parse -genconf asn1_dsa_pub_key.cnf -noout -out dsa_pub_key.der

C:\Users\fyicenter>\local\openssl\openssl 
   pkey -pubin -in dsa_pub_key.der -inform DER -text -noout
pub:
    42:4a:04:37:87:03:b5:1f:ad:65:ce:c2:c5:9b:f6:
    fa:2c:d4:0a:a6:4c:43:97:5b:56:40:04:51:97:98:
    e5:b2:fc:c7:4d:4d:e4:07:b7:38:12:34:1a:bb:ce:
    08:78:cd:2c:a2:3a:45:01:99:2e:63:84:25:31:bc:
    aa:7a:97:02
P:
    00:b2:a2:2f:e4:56:dd:10:93:0c:ee:d2:7d:e2:e5:
    8e:69:e2:7c:b5:2e:14:be:65:5c:5d:0f:4e:dc:4a:
    62:7a:80:0a:21:1d:ab:d9:b0:7d:97:4e:f3:c9:97:
    dd:19:8e:31:c2:b2:38:69:6c:bf:5e:99:84:b1:ee:
    3d:11:b2:d9:e3
Q:
    00:a1:71:45:e1:3e:00:34:69:2f:c1:bd:85:bd:f8:
    8e:1a:a5:78:81:8d
G:
    79:f4:e4:fb:12:34:58:bf:dd:38:8e:0c:c9:0d:77:
    6c:3c:bb:9c:82:e1:06:68:c7:13:18:d3:22:af:59:
    68:ee:8f:b9:f6:4f:9a:c0:9a:9a:aa:24:ad:8d:ed:
    79:5b:7c:e4:bb:81:e0:20:47:aa:c4:d3:e9:55:13:
    aa:8f:d5:dd

 

OpenSSL "ans1parse" - DH Private Key in ASN.1 Structure

OpenSSL "ans1parse" - DSA Public Key in ASN.1 Structure

OpenSSL "ans1parse" Command

⇑⇑ OpenSSL Tutorials

2016-09-26, 4659👍, 0💬