parsing DER format data using SecAsn1Decode

瘦欲@ 提交于 2019-12-24 21:32:59

问题


I'm trying to use SecAsn1Decode in order to parse the following DER encoded data.

However, I failed to define the template for this struct (represented by SecAsn1Template).

perhaps anybody can explain how to create a template for the following DER structure :

here's the binary raw data (DER formatted)

30 81 8E 31 0B 30 09 06  03 55 04 06 13 02 49 4C
31 0F 30 0D 06 03 55 04  08 0C 06 69 73 72 61 65
6C 31 0C 30 0A 06 03 55  04 07 0C 03 54 4C 56 31
0B 30 09 06 03 55 04 0A  0C 02 54 53 31 1E 30 1C
06 03 55 04 0B 0C 15 43  41 5F 63 65 72 74 69 66
69 63 61 74 65 5F 73 65  72 76 65 72 31 1B 30 19
06 03 55 04 03 0C 12 61  61 61 61 61 61 61 4D 61
63 42 6F 6F 6B 5F 50 72  6F 31 16 30 14 06 09 2A
86 48 86 F7 0D 01 09 01  16 07 7A 40 7A 2E 63 6F
6D 

and here's the interpretation of this data using asn1 java decoder https://lapo.it/asn1js

EQUENCE (7 elem)
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 2.5.4.6 countryName (X.520 DN component)
      PrintableString aa
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 2.5.4.8 stateOrProvinceName (X.520 DN component)
      UTF8String aaaaaa
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 2.5.4.7 localityName (X.520 DN component)
      UTF8String aaa
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 2.5.4.10 organizationName (X.520 DN component)
      UTF8String TS
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 2.5.4.11 organizationalUnitName (X.520 DN component)
      UTF8String CA_certificate_server
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 2.5.4.3 commonName (X.520 DN component)
      UTF8String aaaaaaaaaaaaaaaaaa
  SET (1 elem)
    SEQUENCE (2 elem)
      OBJECT IDENTIFIER 1.2.840.113549.1.9.1 emailAddress (PKCS #9. Deprecated, use an altName extension instead)
      IA5String a@a.com

来源:https://stackoverflow.com/questions/59373529/parsing-der-format-data-using-secasn1decode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!