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

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

Issue 1279963003: Add a function for parsing RFC 5280's "TBSCertificate". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert_mapper
Patch Set: Fully move expectations to test data 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
(Empty)
1 $ openssl x509 -inform DER -text -noout < [CERTIFICATE]
2 Certificate:
3 Data:
4 Version: 1 (0x0)
5 Serial Number: 10458 (0x28da)
6 Signature Algorithm: md5WithRSAEncryption
7 Issuer: C=ZA, ST=Western Cape, L=Cape Town, O=Thawte Consulting cc, OU=C ertification Services Division, CN=Thawte Server CA/emailAddress=server-certs@th awte.com
8 Validity
9 Not Before: Sep 29 12:33:37 1998 GMT
10 Not After : Sep 29 12:33:37 1999 GMT
11 Subject: C=UK, ST=Devon, L=Shaldon, O=Web Sight Ltd, OU=web operations, CN=www.web-sight.co.uk
12 Subject Public Key Info:
13 Public Key Algorithm: rsaEncryption
14 Public-Key: (1024 bit)
15 Modulus:
16 00:e4:26:38:1d:18:87:45:ab:36:0b:c8:9a:4f:87:
17 f6:be:8c:34:f2:f6:c7:d2:f3:13:1d:7f:a2:e0:ba:
18 64:73:d0:48:d7:f8:5d:28:c4:df:ce:13:57:7b:bc:
19 d4:f6:57:ee:72:b3:12:46:21:22:42:3d:df:7f:fd:
20 13:21:d2:00:3e:a5:c2:27:a9:f3:43:d8:66:29:10:
21 89:f6:24:3b:59:27:e0:6b:df:ff:5e:3f:93:36:28:
22 11:b8:80:bf:7c:b3:e0:bf:03:42:c2:21:14:e9:ec:
23 92:69:6b:53:20:90:3a:f9:2b:16:28:cb:5d:25:51:
24 2a:31:ae:f7:b5:b5:04:2e:c1
25 Exponent: 65537 (0x10001)
26 Signature Algorithm: md5WithRSAEncryption
27 8f:a7:4e:a9:7a:29:a3:ec:04:13:a6:31:a9:5b:84:f6:e6:ea:
28 b2:86:2a:94:c6:88:7f:c3:49:38:9e:5c:c3:81:f1:b1:a3:ce:
29 c2:e9:f9:55:2d:79:57:16:99:0f:c5:e9:9e:58:9a:c1:a8:b3:
30 8d:75:5e:f5:eb:c1:5d:48:59:e9:f4:1b:aa:1e:b4:2e:71:44:
31 65:d1:ad:43:75:64:52:ec:53:dd:23:9b:31:a9:7d:b1:eb:b8:
32 fd:a7:2f:c4:77:7c:0f:b2:a2:7e:d6:78:4d:32:f1:d2:e7:5a:
33 08:95:c8:ba:a0:11:32:18:4f:e1:76:41:e8:90:53:51:76:d6:
34 8a:7d
35
36
37 $ openssl asn1parse -i -inform DER < [CERTIFICATE]
38 0:d=0 hl=4 l= 691 cons: SEQUENCE
39 4:d=1 hl=4 l= 540 cons: SEQUENCE
40 8:d=2 hl=2 l= 2 prim: INTEGER :28DA
41 12:d=2 hl=2 l= 13 cons: SEQUENCE
42 14:d=3 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
43 25:d=3 hl=2 l= 0 prim: NULL
44 27:d=2 hl=3 l= 196 cons: SEQUENCE
45 30:d=3 hl=2 l= 11 cons: SET
46 32:d=4 hl=2 l= 9 cons: SEQUENCE
47 34:d=5 hl=2 l= 3 prim: OBJECT :countryName
48 39:d=5 hl=2 l= 2 prim: PRINTABLESTRING :ZA
49 43:d=3 hl=2 l= 21 cons: SET
50 45:d=4 hl=2 l= 19 cons: SEQUENCE
51 47:d=5 hl=2 l= 3 prim: OBJECT :stateOrProvinceName
52 52:d=5 hl=2 l= 12 prim: PRINTABLESTRING :Western Cape
53 66:d=3 hl=2 l= 18 cons: SET
54 68:d=4 hl=2 l= 16 cons: SEQUENCE
55 70:d=5 hl=2 l= 3 prim: OBJECT :localityName
56 75:d=5 hl=2 l= 9 prim: PRINTABLESTRING :Cape Town
57 86:d=3 hl=2 l= 29 cons: SET
58 88:d=4 hl=2 l= 27 cons: SEQUENCE
59 90:d=5 hl=2 l= 3 prim: OBJECT :organizationName
60 95:d=5 hl=2 l= 20 prim: PRINTABLESTRING :Thawte Consulting cc
61 117:d=3 hl=2 l= 40 cons: SET
62 119:d=4 hl=2 l= 38 cons: SEQUENCE
63 121:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName
64 126:d=5 hl=2 l= 31 prim: PRINTABLESTRING :Certification Services Divi sion
65 159:d=3 hl=2 l= 25 cons: SET
66 161:d=4 hl=2 l= 23 cons: SEQUENCE
67 163:d=5 hl=2 l= 3 prim: OBJECT :commonName
68 168:d=5 hl=2 l= 16 prim: PRINTABLESTRING :Thawte Server CA
69 186:d=3 hl=2 l= 38 cons: SET
70 188:d=4 hl=2 l= 36 cons: SEQUENCE
71 190:d=5 hl=2 l= 9 prim: OBJECT :emailAddress
72 201:d=5 hl=2 l= 23 prim: IA5STRING :server-certs@thawte.com
73 226:d=2 hl=2 l= 30 cons: SEQUENCE
74 228:d=3 hl=2 l= 13 prim: UTCTIME :980929123337Z
75 243:d=3 hl=2 l= 13 prim: UTCTIME :990929123337Z
76 258:d=2 hl=2 l= 126 cons: SEQUENCE
77 260:d=3 hl=2 l= 11 cons: SET
78 262:d=4 hl=2 l= 9 cons: SEQUENCE
79 264:d=5 hl=2 l= 3 prim: OBJECT :countryName
80 269:d=5 hl=2 l= 2 prim: PRINTABLESTRING :UK
81 273:d=3 hl=2 l= 14 cons: SET
82 275:d=4 hl=2 l= 12 cons: SEQUENCE
83 277:d=5 hl=2 l= 3 prim: OBJECT :stateOrProvinceName
84 282:d=5 hl=2 l= 5 prim: PRINTABLESTRING :Devon
85 289:d=3 hl=2 l= 16 cons: SET
86 291:d=4 hl=2 l= 14 cons: SEQUENCE
87 293:d=5 hl=2 l= 3 prim: OBJECT :localityName
88 298:d=5 hl=2 l= 7 prim: PRINTABLESTRING :Shaldon
89 307:d=3 hl=2 l= 22 cons: SET
90 309:d=4 hl=2 l= 20 cons: SEQUENCE
91 311:d=5 hl=2 l= 3 prim: OBJECT :organizationName
92 316:d=5 hl=2 l= 13 prim: PRINTABLESTRING :Web Sight Ltd
93 331:d=3 hl=2 l= 23 cons: SET
94 333:d=4 hl=2 l= 21 cons: SEQUENCE
95 335:d=5 hl=2 l= 3 prim: OBJECT :organizationalUnitName
96 340:d=5 hl=2 l= 14 prim: PRINTABLESTRING :web operations
97 356:d=3 hl=2 l= 28 cons: SET
98 358:d=4 hl=2 l= 26 cons: SEQUENCE
99 360:d=5 hl=2 l= 3 prim: OBJECT :commonName
100 365:d=5 hl=2 l= 19 prim: PRINTABLESTRING :www.web-sight.co.uk
101 386:d=2 hl=3 l= 159 cons: SEQUENCE
102 389:d=3 hl=2 l= 13 cons: SEQUENCE
103 391:d=4 hl=2 l= 9 prim: OBJECT :rsaEncryption
104 402:d=4 hl=2 l= 0 prim: NULL
105 404:d=3 hl=3 l= 141 prim: BIT STRING
106 548:d=1 hl=2 l= 13 cons: SEQUENCE
107 550:d=2 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
108 561:d=2 hl=2 l= 0 prim: NULL
109 563:d=1 hl=3 l= 129 prim: BIT STRING
110 -----BEGIN CERTIFICATE-----
111 MIICszCCAhwCAijaMA0GCSqGSIb3DQEBBAUAMIHEMQswCQYDVQQGEwJaQTEVMBMGA1UECBMMV2V
112 zdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoTFFRoYXd0ZSBDb25zdWx0aW
113 5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMRkwFwYDVQQDE
114 xBUaGF3dGUgU2VydmVyIENBMSYwJAYJKoZIhvcNAQkBFhdzZXJ2ZXItY2VydHNAdGhhd3RlLmNv
115 bTAeFw05ODA5MjkxMjMzMzdaFw05OTA5MjkxMjMzMzdaMH4xCzAJBgNVBAYTAlVLMQ4wDAYDVQQ
116 IEwVEZXZvbjEQMA4GA1UEBxMHU2hhbGRvbjEWMBQGA1UEChMNV2ViIFNpZ2h0IEx0ZDEXMBUGA1
117 UECxMOd2ViIG9wZXJhdGlvbnMxHDAaBgNVBAMTE3d3dy53ZWItc2lnaHQuY28udWswgZ8wDQYJK
118 oZIhvcNAQEBBQADgY0AMIGJAoGBAOQmOB0Yh0WrNgvImk+H9r6MNPL2x9LzEx1/ouC6ZHPQSNf4
119 XSjE384TV3u81PZX7nKzEkYhIkI933/9EyHSAD6lwiep80PYZikQifYkO1kn4Gvf/14/kzYoEbi
120 Av3yz4L8DQsIhFOnskmlrUyCQOvkrFijLXSVRKjGu97W1BC7BAgMBAAEwDQYJKoZIhvcNAQEEBQ
121 ADgYEAj6dOqXopo+wEE6YxqVuE9ubqsoYqlMaIf8NJOJ5cw4HxsaPOwun5VS15VxaZD8Xpnliaw
122 aizjXVe9evBXUhZ6fQbqh60LnFEZdGtQ3VkUuxT3SObMal9seu4/acvxHd8D7KiftZ4TTLx0uda
123 CJXIuqARMhhP4XZB6JBTUXbWin0=
124 -----END CERTIFICATE-----
125
126
127 -----BEGIN SIGNATURE-----
128 j6dOqXopo+wEE6YxqVuE9ubqsoYqlMaIf8NJOJ5cw4HxsaPOwun5VS15VxaZD8XpnliawaizjXV
129 e9evBXUhZ6fQbqh60LnFEZdGtQ3VkUuxT3SObMal9seu4/acvxHd8D7KiftZ4TTLx0udaCJXIuq
130 ARMhhP4XZB6JBTUXbWin0=
131 -----END SIGNATURE-----
132
133 $ openssl asn1parse -i -inform DER < [SIGNATURE ALGORITHM]
134 0:d=0 hl=2 l= 13 cons: SEQUENCE
135 2:d=1 hl=2 l= 9 prim: OBJECT :md5WithRSAEncryption
136 13:d=1 hl=2 l= 0 prim: NULL
137 -----BEGIN SIGNATURE ALGORITHM-----
138 MA0GCSqGSIb3DQEBBAUA
139 -----END SIGNATURE ALGORITHM-----
140
141
142 -----BEGIN SERIAL NUMBER-----
143 KNo=
144 -----END SERIAL NUMBER-----
145
146 $ openssl asn1parse -i -inform DER < [ISSUER]
147 0:d=0 hl=3 l= 196 cons: SEQUENCE
148 3:d=1 hl=2 l= 11 cons: SET
149 5:d=2 hl=2 l= 9 cons: SEQUENCE
150 7:d=3 hl=2 l= 3 prim: OBJECT :countryName
151 12:d=3 hl=2 l= 2 prim: PRINTABLESTRING :ZA
152 16:d=1 hl=2 l= 21 cons: SET
153 18:d=2 hl=2 l= 19 cons: SEQUENCE
154 20:d=3 hl=2 l= 3 prim: OBJECT :stateOrProvinceName
155 25:d=3 hl=2 l= 12 prim: PRINTABLESTRING :Western Cape
156 39:d=1 hl=2 l= 18 cons: SET
157 41:d=2 hl=2 l= 16 cons: SEQUENCE
158 43:d=3 hl=2 l= 3 prim: OBJECT :localityName
159 48:d=3 hl=2 l= 9 prim: PRINTABLESTRING :Cape Town
160 59:d=1 hl=2 l= 29 cons: SET
161 61:d=2 hl=2 l= 27 cons: SEQUENCE
162 63:d=3 hl=2 l= 3 prim: OBJECT :organizationName
163 68:d=3 hl=2 l= 20 prim: PRINTABLESTRING :Thawte Consulting cc
164 90:d=1 hl=2 l= 40 cons: SET
165 92:d=2 hl=2 l= 38 cons: SEQUENCE
166 94:d=3 hl=2 l= 3 prim: OBJECT :organizationalUnitName
167 99:d=3 hl=2 l= 31 prim: PRINTABLESTRING :Certification Services Divisi on
168 132:d=1 hl=2 l= 25 cons: SET
169 134:d=2 hl=2 l= 23 cons: SEQUENCE
170 136:d=3 hl=2 l= 3 prim: OBJECT :commonName
171 141:d=3 hl=2 l= 16 prim: PRINTABLESTRING :Thawte Server CA
172 159:d=1 hl=2 l= 38 cons: SET
173 161:d=2 hl=2 l= 36 cons: SEQUENCE
174 163:d=3 hl=2 l= 9 prim: OBJECT :emailAddress
175 174:d=3 hl=2 l= 23 prim: IA5STRING :server-certs@thawte.com
176 -----BEGIN ISSUER-----
177 MIHEMQswCQYDVQQGEwJaQTEVMBMGA1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFR
178 vd24xHTAbBgNVBAoTFFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW
179 9uIFNlcnZpY2VzIERpdmlzaW9uMRkwFwYDVQQDExBUaGF3dGUgU2VydmVyIENBMSYwJAYJKoZIh
180 vcNAQkBFhdzZXJ2ZXItY2VydHNAdGhhd3RlLmNvbQ==
181 -----END ISSUER-----
182
183 $ openssl asn1parse -i -inform DER < [VALIDITY]
184 0:d=0 hl=2 l= 30 cons: SEQUENCE
185 2:d=1 hl=2 l= 13 prim: UTCTIME :980929123337Z
186 17:d=1 hl=2 l= 13 prim: UTCTIME :990929123337Z
187 -----BEGIN VALIDITY-----
188 MB4XDTk4MDkyOTEyMzMzN1oXDTk5MDkyOTEyMzMzN1o=
189 -----END VALIDITY-----
190
191 $ openssl asn1parse -i -inform DER < [SUBJECT]
192 0:d=0 hl=2 l= 126 cons: SEQUENCE
193 2:d=1 hl=2 l= 11 cons: SET
194 4:d=2 hl=2 l= 9 cons: SEQUENCE
195 6:d=3 hl=2 l= 3 prim: OBJECT :countryName
196 11:d=3 hl=2 l= 2 prim: PRINTABLESTRING :UK
197 15:d=1 hl=2 l= 14 cons: SET
198 17:d=2 hl=2 l= 12 cons: SEQUENCE
199 19:d=3 hl=2 l= 3 prim: OBJECT :stateOrProvinceName
200 24:d=3 hl=2 l= 5 prim: PRINTABLESTRING :Devon
201 31:d=1 hl=2 l= 16 cons: SET
202 33:d=2 hl=2 l= 14 cons: SEQUENCE
203 35:d=3 hl=2 l= 3 prim: OBJECT :localityName
204 40:d=3 hl=2 l= 7 prim: PRINTABLESTRING :Shaldon
205 49:d=1 hl=2 l= 22 cons: SET
206 51:d=2 hl=2 l= 20 cons: SEQUENCE
207 53:d=3 hl=2 l= 3 prim: OBJECT :organizationName
208 58:d=3 hl=2 l= 13 prim: PRINTABLESTRING :Web Sight Ltd
209 73:d=1 hl=2 l= 23 cons: SET
210 75:d=2 hl=2 l= 21 cons: SEQUENCE
211 77:d=3 hl=2 l= 3 prim: OBJECT :organizationalUnitName
212 82:d=3 hl=2 l= 14 prim: PRINTABLESTRING :web operations
213 98:d=1 hl=2 l= 28 cons: SET
214 100:d=2 hl=2 l= 26 cons: SEQUENCE
215 102:d=3 hl=2 l= 3 prim: OBJECT :commonName
216 107:d=3 hl=2 l= 19 prim: PRINTABLESTRING :www.web-sight.co.uk
217 -----BEGIN SUBJECT-----
218 MH4xCzAJBgNVBAYTAlVLMQ4wDAYDVQQIEwVEZXZvbjEQMA4GA1UEBxMHU2hhbGRvbjEWMBQGA1U
219 EChMNV2ViIFNpZ2h0IEx0ZDEXMBUGA1UECxMOd2ViIG9wZXJhdGlvbnMxHDAaBgNVBAMTE3d3dy
220 53ZWItc2lnaHQuY28udWs=
221 -----END SUBJECT-----
222
223 $ openssl asn1parse -i -inform DER < [SPKI]
224 0:d=0 hl=3 l= 159 cons: SEQUENCE
225 3:d=1 hl=2 l= 13 cons: SEQUENCE
226 5:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption
227 16:d=2 hl=2 l= 0 prim: NULL
228 18:d=1 hl=3 l= 141 prim: BIT STRING
229 -----BEGIN SPKI-----
230 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDkJjgdGIdFqzYLyJpPh/a+jDTy9sfS8xMdf6L
231 gumRz0EjX+F0oxN/OE1d7vNT2V+5ysxJGISJCPd9//RMh0gA+pcInqfND2GYpEIn2JDtZJ+Br3/
232 9eP5M2KBG4gL98s+C/A0LCIRTp7JJpa1MgkDr5KxYoy10lUSoxrve1tQQuwQIDAQAB
233 -----END SPKI-----
234
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698