reactos icon indicating copy to clipboard operation
reactos copied to clipboard

[CERTUTIL] Add -asn verb

Open learn-more opened this issue 5 years ago • 1 comments

Purpose

Output format based on Windows' version, but it is not a 1:1 match.

TODO:

  • [ ] Pretty-print text/strings
  • [ ] Pretty-print date/time

Adds output like:

0000: 30 82 01 bf                                       ; SEQUENCE (1bf Bytes)
0004:    30 82 01 6d                                    ; SEQUENCE (16d Bytes)
0008:    |  a0 03                                       ; OPTIONAL[0] (3 Bytes)
000a:    |  |  02 01                                    ; INTEGER (1 Bytes)
000c:    |  |     02 
000d:    |  02 10                                       ; INTEGER (10 Bytes)
000f:    |  |  86 bb af 93 85 c2 8c 87 4d f1 01 d9 47 99 0d a9 
001f:    |  30 09                                       ; SEQUENCE (9 Bytes)
0021:    |  |  06 05                                    ; OBJECT_ID (5 Bytes)
0023:    |  |  |  2b 0e 03 02 1d 
         |  |  |     ; 1.3.14.3.2.29 sha1RSA (shaRSA)
0028:    |  |  05 00                                    ; NULL (0 Bytes)
002a:    |  30 16                                       ; SEQUENCE (16 Bytes)
002c:    |  |  31 14                                    ; SET (14 Bytes)
002e:    |  |     30 12                                 ; SEQUENCE (12 Bytes)
0030:    |  |        06 03                              ; OBJECT_ID (3 Bytes)
0032:    |  |        |  55 04 03 
         |  |        |     ; 2.5.4.3 CN (Common Name)
0035:    |  |        13 0b                              ; PRINTABLE_STRING (b Bytes)
0037:    |  |           52 6f 6f 74 20 41 67 65 6e 63 79 
0042:    |  30 1e                                       ; SEQUENCE (1e Bytes)
0044:    |  |  17 0d                                    ; UTC_TIME (d Bytes)
0046:    |  |  |  31 31 31 30 30 36 30 35 34 39 35 34 5a 
0053:    |  |  17 0d                                    ; UTC_TIME (d Bytes)
0055:    |  |     33 39 31 32 33 31 32 33 35 39 35 39 5a 
0062:    |  30 22                                       ; SEQUENCE (22 Bytes)
0064:    |  |  31 20                                    ; SET (20 Bytes)
0066:    |  |     30 1e                                 ; SEQUENCE (1e Bytes)
0068:    |  |        06 03                              ; OBJECT_ID (3 Bytes)
006a:    |  |        |  55 04 03 
         |  |        |     ; 2.5.4.3 CN (Common Name)
006d:    |  |        13 17                              ; PRINTABLE_STRING (17 Bytes)
006f:    |  |           4a 6f 65 27 73 2d 53 6f 66 74 77 61 72 65 2d 45 
007f:    |  |           6d 70 6f 72 69 75 6d 
0086:    |  30 81 9f                                    ; SEQUENCE (9f Bytes)
0089:    |  |  30 0d                                    ; SEQUENCE (d Bytes)
008b:    |  |  |  06 09                                 ; OBJECT_ID (9 Bytes)
008d:    |  |  |  |  2a 86 48 86 f7 0d 01 01 01 
         |  |  |  |     ; 1.2.840.113549.1.1.1 RSA (RSA_KEYX / RSA_SIGN)
0096:    |  |  |  05 00                                 ; NULL (0 Bytes)
0098:    |  |  03 81 8d                                 ; BIT_STRING (8d Bytes)
009b:    |  |     00 
009c:    |  |     30 81 89                              ; SEQUENCE (89 Bytes)
009f:    |  |        02 81 81                           ; INTEGER (81 Bytes)
00a2:    |  |        |  00 a2 f0 61 94 4b 9d 73 e6 c7 97 d0 17 ce 35 c2 
00b2:    |  |        |  38 3d 1c 64 c6 7b 35 ed 2c 95 8e 4b a3 72 d5 ab 
00c2:    |  |        |  88 34 4f 88 0f f4 38 ca 81 9c bc 53 c1 2e d6 19 
00d2:    |  |        |  51 3b 10 e3 79 c8 9c 37 57 56 a7 c9 26 7d a7 c6 
00e2:    |  |        |  59 d9 86 4d cd cb 31 f8 dc 79 6c 34 29 a9 e7 0d 
00f2:    |  |        |  ca 66 af 26 3f a5 df ac 6a 04 ae 66 53 88 3d 8d 
0102:    |  |        |  15 b1 0e 8d 54 52 85 3d 0e a1 d5 17 c6 d8 cc 38 
0112:    |  |        |  62 aa 63 41 a5 e0 05 23 9d d3 be c3 94 60 69 06 
0122:    |  |        |  ad 
0123:    |  |        02 03                              ; INTEGER (3 Bytes)
0125:    |  |           01 00 01 
0128:    |  a3 4b                                       ; OPTIONAL[3] (4b Bytes)
012a:    |     30 49                                    ; SEQUENCE (49 Bytes)
012c:    |        30 47                                 ; SEQUENCE (47 Bytes)
012e:    |           06 03                              ; OBJECT_ID (3 Bytes)
0130:    |           |  55 1d 01 
         |           |     ; 2.5.29.1 Authority Key Identifier
0133:    |           04 40                              ; OCTET_STRING (40 Bytes)
0135:    |              30 3e                           ; SEQUENCE (3e Bytes)
0137:    |                 80 10                        ; CONTEXT_SPECIFIC[0] (10 Bytes)
0139:    |                 |  12 e4 09 2d 06 1d 1d 4f 00 8d 61 21 dc 16 64 63 
0149:    |                 a1 18                        ; OPTIONAL[1] (18 Bytes)
014b:    |                 |  30 16                     ; SEQUENCE (16 Bytes)
014d:    |                 |     31 14                  ; SET (14 Bytes)
014f:    |                 |        30 12               ; SEQUENCE (12 Bytes)
0151:    |                 |           06 03            ; OBJECT_ID (3 Bytes)
0153:    |                 |           |  55 04 03 
         |                 |           |     ; 2.5.4.3 CN (Common Name)
0156:    |                 |           13 0b            ; PRINTABLE_STRING (b Bytes)
0158:    |                 |              52 6f 6f 74 20 41 67 65 6e 63 79 
0163:    |                 82 10                        ; CONTEXT_SPECIFIC[2] (10 Bytes)
0165:    |                    06 37 6c 00 aa 00 64 8a 11 cf b8 d4 aa 5c 35 f4 
0175:    30 09                                          ; SEQUENCE (9 Bytes)
0177:    |  06 05                                       ; OBJECT_ID (5 Bytes)
0179:    |  |  2b 0e 03 02 1d 
         |  |     ; 1.3.14.3.2.29 sha1RSA (shaRSA)
017e:    |  05 00                                       ; NULL (0 Bytes)
0180:    03 41                                          ; BIT_STRING (41 Bytes)
0182:       00 
0183:       79 a0 b8 9e 7e c9 b9 b6 00 c4 64 7a ad 4d 64 dd 
0193:       07 61 4d 26 cb 3f f8 f0 d8 72 dc ea 0a 57 cb ee 
01a3:       bc 97 da ce 75 cd e2 fd bf 9f 92 e0 34 73 03 26 
01b3:       86 22 ca 85 ca ac ec 8c 08 e4 e5 86 91 a2 d3 6b 
CertUtil: -asn command completed successfully

learn-more avatar Sep 11 '20 22:09 learn-more