Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: net/data/parse_certificate_unittest/tbs_v2_no_optionals.pem

Issue 1285593003: Add parsing code for TBSCertificate's "validity" field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_parsing
Patch Set: rebase and fix a comment Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 This is a version 2 certificate with none of the optional fields. 1 This is a version 2 certificate with none of the optional fields.
2 2
3 3
4 4
5 -----BEGIN TBS CERTIFICATE----- 5 -----BEGIN TBS CERTIFICATE-----
6 MCGgAwIBAQIBATADBAEBMAMEAQUwAwQBCDADBAEKMAMEAfM= 6 MDygAwIBAQIBATADBAEBMAMEAQUwHhcNMTIxMDE4MDMxMjAwWhcNMTMxMDE4MTQ1OTU5WjADBAG
7 DMAMEAfM=
7 -----END TBS CERTIFICATE----- 8 -----END TBS CERTIFICATE-----
8 9
9 $ openssl asn1parse -i < [TBS CERTIFICATE] 10 $ openssl asn1parse -i < [TBS CERTIFICATE]
10 0:d=0 hl=2 l= 33 cons: SEQUENCE 11 0:d=0 hl=2 l= 60 cons: SEQUENCE
11 2:d=1 hl=2 l= 3 cons: cont [ 0 ] 12 2:d=1 hl=2 l= 3 cons: cont [ 0 ]
12 4:d=2 hl=2 l= 1 prim: INTEGER :01 13 4:d=2 hl=2 l= 1 prim: INTEGER :01
13 7:d=1 hl=2 l= 1 prim: INTEGER :01 14 7:d=1 hl=2 l= 1 prim: INTEGER :01
14 10:d=1 hl=2 l= 3 cons: SEQUENCE 15 10:d=1 hl=2 l= 3 cons: SEQUENCE
15 12:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01 16 12:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
16 15:d=1 hl=2 l= 3 cons: SEQUENCE 17 15:d=1 hl=2 l= 3 cons: SEQUENCE
17 17:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05 18 17:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
18 20:d=1 hl=2 l= 3 cons: SEQUENCE 19 20:d=1 hl=2 l= 30 cons: SEQUENCE
19 22:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08 20 22:d=2 hl=2 l= 13 prim: UTCTIME :121018031200Z
20 25:d=1 hl=2 l= 3 cons: SEQUENCE 21 37:d=2 hl=2 l= 13 prim: UTCTIME :131018145959Z
21 27:d=2 hl=2 l= 1 prim: OCTET STRING : 22 52:d=1 hl=2 l= 3 cons: SEQUENCE
22 23 54:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:83
23 30:d=1 hl=2 l= 3 cons: SEQUENCE 24 57:d=1 hl=2 l= 3 cons: SEQUENCE
24 32:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3 25 59:d=2 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
25 26
26 27
27 28
28 -----BEGIN SERIAL NUMBER----- 29 -----BEGIN SERIAL NUMBER-----
29 AQ== 30 AQ==
30 -----END SERIAL NUMBER----- 31 -----END SERIAL NUMBER-----
31 32
32 33
33 34
34 -----BEGIN SIGNATURE ALGORITHM----- 35 -----BEGIN SIGNATURE ALGORITHM-----
35 MAMEAQE= 36 MAMEAQE=
36 -----END SIGNATURE ALGORITHM----- 37 -----END SIGNATURE ALGORITHM-----
37 38
38 $ openssl asn1parse -i < [SIGNATURE ALGORITHM] 39 $ openssl asn1parse -i < [SIGNATURE ALGORITHM]
39 0:d=0 hl=2 l= 3 cons: SEQUENCE 40 0:d=0 hl=2 l= 3 cons: SEQUENCE
40 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01 41 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:01
41 42
42 43
43 44
44 -----BEGIN ISSUER----- 45 -----BEGIN ISSUER-----
45 MAMEAQU= 46 MAMEAQU=
46 -----END ISSUER----- 47 -----END ISSUER-----
47 48
48 $ openssl asn1parse -i < [ISSUER] 49 $ openssl asn1parse -i < [ISSUER]
49 0:d=0 hl=2 l= 3 cons: SEQUENCE 50 0:d=0 hl=2 l= 3 cons: SEQUENCE
50 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05 51 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:05
51 52
52 53
53 54
54 -----BEGIN VALIDITY----- 55 -----BEGIN VALIDITY NOTBEFORE-----
55 MAMEAQg= 56 eWVhcj0yMDEyLCBtb250aD0xMCwgZGF5PTE4LCBob3Vycz0zLCBtaW51dGVzPTEyLCBzZWNvbmR
56 -----END VALIDITY----- 57 zPTA=
58 -----END VALIDITY NOTBEFORE-----
57 59
58 $ openssl asn1parse -i < [VALIDITY] 60 VALIDITY NOTBEFORE: year=2012, month=10, day=18, hours=3, minutes=12, seconds=0
59 0:d=0 hl=2 l= 3 cons: SEQUENCE 61
60 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:08 62
63
64 -----BEGIN VALIDITY NOTAFTER-----
65 eWVhcj0yMDEzLCBtb250aD0xMCwgZGF5PTE4LCBob3Vycz0xNCwgbWludXRlcz01OSwgc2Vjb25
66 kcz01OQ==
67 -----END VALIDITY NOTAFTER-----
68
69 VALIDITY NOTAFTER: year=2013, month=10, day=18, hours=14, minutes=59, seconds=59
61 70
62 71
63 72
64 -----BEGIN SUBJECT----- 73 -----BEGIN SUBJECT-----
65 MAMEAQo= 74 MAMEAYM=
66 -----END SUBJECT----- 75 -----END SUBJECT-----
67 76
68 $ openssl asn1parse -i < [SUBJECT] 77 $ openssl asn1parse -i < [SUBJECT]
69 0:d=0 hl=2 l= 3 cons: SEQUENCE 78 0:d=0 hl=2 l= 3 cons: SEQUENCE
70 2:d=1 hl=2 l= 1 prim: OCTET STRING : 79 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:83
71 80
72 81
73 82
74 -----BEGIN SPKI----- 83 -----BEGIN SPKI-----
75 MAMEAfM= 84 MAMEAfM=
76 -----END SPKI----- 85 -----END SPKI-----
77 86
78 $ openssl asn1parse -i < [SPKI] 87 $ openssl asn1parse -i < [SPKI]
79 0:d=0 hl=2 l= 3 cons: SEQUENCE 88 0:d=0 hl=2 l= 3 cons: SEQUENCE
80 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3 89 2:d=1 hl=2 l= 1 prim: OCTET STRING [HEX DUMP]:F3
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698