r509 0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. data/README.md +447 -0
  2. data/Rakefile +38 -0
  3. data/bin/r509 +96 -0
  4. data/bin/r509-parse +35 -0
  5. data/doc/R509.html +154 -0
  6. data/doc/R509/Cert.html +3954 -0
  7. data/doc/R509/Cert/Extensions.html +360 -0
  8. data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +391 -0
  9. data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +148 -0
  10. data/doc/R509/Cert/Extensions/BasicConstraints.html +482 -0
  11. data/doc/R509/Cert/Extensions/CrlDistributionPoints.html +316 -0
  12. data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +780 -0
  13. data/doc/R509/Cert/Extensions/KeyUsage.html +1230 -0
  14. data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +467 -0
  15. data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +216 -0
  16. data/doc/R509/CertificateAuthority.html +126 -0
  17. data/doc/R509/CertificateAuthority/Signer.html +855 -0
  18. data/doc/R509/Config.html +127 -0
  19. data/doc/R509/Config/CaConfig.html +2144 -0
  20. data/doc/R509/Config/CaConfigPool.html +599 -0
  21. data/doc/R509/Config/CaProfile.html +656 -0
  22. data/doc/R509/Config/SubjectItemPolicy.html +578 -0
  23. data/doc/R509/Crl.html +126 -0
  24. data/doc/R509/Crl/Administrator.html +2077 -0
  25. data/doc/R509/Crl/Parser.html +1224 -0
  26. data/doc/R509/Csr.html +2248 -0
  27. data/doc/R509/IOHelpers.html +564 -0
  28. data/doc/R509/MessageDigest.html +396 -0
  29. data/doc/R509/NameSanitizer.html +319 -0
  30. data/doc/R509/Ocsp.html +128 -0
  31. data/doc/R509/Ocsp/Request.html +126 -0
  32. data/doc/R509/Ocsp/Request/Nonce.html +160 -0
  33. data/doc/R509/Ocsp/Response.html +837 -0
  34. data/doc/R509/OidMapper.html +393 -0
  35. data/doc/R509/PrivateKey.html +1647 -0
  36. data/doc/R509/R509Error.html +134 -0
  37. data/doc/R509/Spki.html +1424 -0
  38. data/doc/R509/Subject.html +836 -0
  39. data/doc/R509/Validity.html +160 -0
  40. data/doc/R509/Validity/Checker.html +320 -0
  41. data/doc/R509/Validity/DefaultChecker.html +283 -0
  42. data/doc/R509/Validity/DefaultWriter.html +330 -0
  43. data/doc/R509/Validity/Status.html +561 -0
  44. data/doc/R509/Validity/Writer.html +394 -0
  45. data/doc/_index.html +501 -0
  46. data/doc/class_list.html +53 -0
  47. data/doc/css/common.css +1 -0
  48. data/doc/css/full_list.css +57 -0
  49. data/doc/css/style.css +328 -0
  50. data/doc/file.README.html +534 -0
  51. data/doc/file.r509.html +149 -0
  52. data/doc/file_list.html +58 -0
  53. data/doc/frames.html +28 -0
  54. data/doc/index.html +534 -0
  55. data/doc/js/app.js +208 -0
  56. data/doc/js/full_list.js +173 -0
  57. data/doc/js/jquery.js +4 -0
  58. data/doc/methods_list.html +1932 -0
  59. data/doc/top-level-namespace.html +112 -0
  60. data/lib/r509.rb +22 -0
  61. data/lib/r509/cert.rb +414 -0
  62. data/lib/r509/cert/extensions.rb +309 -0
  63. data/lib/r509/certificateauthority.rb +290 -0
  64. data/lib/r509/config.rb +407 -0
  65. data/lib/r509/crl.rb +379 -0
  66. data/lib/r509/csr.rb +324 -0
  67. data/lib/r509/exceptions.rb +5 -0
  68. data/lib/r509/io_helpers.rb +52 -0
  69. data/lib/r509/messagedigest.rb +49 -0
  70. data/lib/r509/ocsp.rb +85 -0
  71. data/lib/r509/oidmapper.rb +32 -0
  72. data/lib/r509/privatekey.rb +185 -0
  73. data/lib/r509/spki.rb +112 -0
  74. data/lib/r509/subject.rb +133 -0
  75. data/lib/r509/validity.rb +92 -0
  76. data/lib/r509/version.rb +4 -0
  77. data/r509.yaml +73 -0
  78. data/spec/cert/extensions_spec.rb +632 -0
  79. data/spec/cert_spec.rb +321 -0
  80. data/spec/certificate_authority_spec.rb +260 -0
  81. data/spec/config_spec.rb +349 -0
  82. data/spec/crl_spec.rb +215 -0
  83. data/spec/csr_spec.rb +302 -0
  84. data/spec/fixtures.rb +233 -0
  85. data/spec/fixtures/cert1.der +0 -0
  86. data/spec/fixtures/cert1.pem +24 -0
  87. data/spec/fixtures/cert1_public_key_modulus.txt +1 -0
  88. data/spec/fixtures/cert3.p12 +0 -0
  89. data/spec/fixtures/cert3.pem +28 -0
  90. data/spec/fixtures/cert3_key.pem +27 -0
  91. data/spec/fixtures/cert3_key_des3.pem +30 -0
  92. data/spec/fixtures/cert4.pem +14 -0
  93. data/spec/fixtures/cert5.pem +30 -0
  94. data/spec/fixtures/cert6.pem +26 -0
  95. data/spec/fixtures/cert_expired.pem +26 -0
  96. data/spec/fixtures/cert_not_yet_valid.pem +26 -0
  97. data/spec/fixtures/cert_san.pem +27 -0
  98. data/spec/fixtures/cert_san2.pem +22 -0
  99. data/spec/fixtures/config_pool_test_minimal.yaml +15 -0
  100. data/spec/fixtures/config_test.yaml +41 -0
  101. data/spec/fixtures/config_test_engine_key.yaml +7 -0
  102. data/spec/fixtures/config_test_engine_no_key_name.yaml +6 -0
  103. data/spec/fixtures/config_test_minimal.yaml +7 -0
  104. data/spec/fixtures/config_test_password.yaml +7 -0
  105. data/spec/fixtures/config_test_various.yaml +100 -0
  106. data/spec/fixtures/crl_list_file.txt +1 -0
  107. data/spec/fixtures/crl_with_reason.pem +17 -0
  108. data/spec/fixtures/csr1.der +0 -0
  109. data/spec/fixtures/csr1.pem +17 -0
  110. data/spec/fixtures/csr1_key.der +0 -0
  111. data/spec/fixtures/csr1_key.pem +27 -0
  112. data/spec/fixtures/csr1_key_encrypted_des3.pem +30 -0
  113. data/spec/fixtures/csr1_newlines.pem +32 -0
  114. data/spec/fixtures/csr1_no_begin_end.pem +15 -0
  115. data/spec/fixtures/csr1_public_key_modulus.txt +1 -0
  116. data/spec/fixtures/csr2.pem +15 -0
  117. data/spec/fixtures/csr2_key.pem +27 -0
  118. data/spec/fixtures/csr3.pem +16 -0
  119. data/spec/fixtures/csr4.pem +25 -0
  120. data/spec/fixtures/csr_dsa.pem +15 -0
  121. data/spec/fixtures/csr_invalid_signature.pem +13 -0
  122. data/spec/fixtures/dsa_key.pem +20 -0
  123. data/spec/fixtures/key4.pem +27 -0
  124. data/spec/fixtures/key4_encrypted_des3.pem +30 -0
  125. data/spec/fixtures/missing_key_identifier_ca.cer +21 -0
  126. data/spec/fixtures/missing_key_identifier_ca.key +27 -0
  127. data/spec/fixtures/ocsptest.r509.local.pem +27 -0
  128. data/spec/fixtures/ocsptest.r509.local_ocsp_request.der +0 -0
  129. data/spec/fixtures/ocsptest2.r509.local.pem +27 -0
  130. data/spec/fixtures/second_ca.cer +26 -0
  131. data/spec/fixtures/second_ca.key +27 -0
  132. data/spec/fixtures/spkac.der +0 -0
  133. data/spec/fixtures/spkac.txt +1 -0
  134. data/spec/fixtures/spkac_dsa.txt +1 -0
  135. data/spec/fixtures/stca.pem +22 -0
  136. data/spec/fixtures/stca_ocsp_request.der +0 -0
  137. data/spec/fixtures/stca_ocsp_response.der +0 -0
  138. data/spec/fixtures/test1.csr +17 -0
  139. data/spec/fixtures/test_ca.cer +22 -0
  140. data/spec/fixtures/test_ca.key +28 -0
  141. data/spec/fixtures/test_ca.p12 +0 -0
  142. data/spec/fixtures/test_ca_des3.key +30 -0
  143. data/spec/fixtures/test_ca_ocsp.cer +26 -0
  144. data/spec/fixtures/test_ca_ocsp.key +27 -0
  145. data/spec/fixtures/test_ca_ocsp.p12 +0 -0
  146. data/spec/fixtures/test_ca_ocsp_chain.txt +48 -0
  147. data/spec/fixtures/test_ca_ocsp_response.der +0 -0
  148. data/spec/fixtures/test_ca_subroot.cer +26 -0
  149. data/spec/fixtures/test_ca_subroot.key +27 -0
  150. data/spec/fixtures/test_ca_subroot_ocsp.cer +25 -0
  151. data/spec/fixtures/test_ca_subroot_ocsp.key +27 -0
  152. data/spec/fixtures/test_ca_subroot_ocsp_response.der +0 -0
  153. data/spec/fixtures/unknown_oid.csr +17 -0
  154. data/spec/message_digest_spec.rb +89 -0
  155. data/spec/ocsp_spec.rb +111 -0
  156. data/spec/oid_mapper_spec.rb +31 -0
  157. data/spec/privatekey_spec.rb +198 -0
  158. data/spec/spec_helper.rb +14 -0
  159. data/spec/spki_spec.rb +157 -0
  160. data/spec/subject_spec.rb +203 -0
  161. data/spec/validity_spec.rb +98 -0
  162. metadata +257 -0
@@ -0,0 +1,1224 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: R509::Crl::Parser
8
+
9
+ &mdash; Documentation by YARD 0.8.0
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (P)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../R509.html" title="R509 (module)">R509</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Crl.html" title="R509::Crl (module)">Crl</a></span></span>
36
+ &raquo;
37
+ <span class="title">Parser</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: R509::Crl::Parser
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">R509::Crl::Parser</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/r509/crl.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+
103
+
104
+
105
+
106
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
107
+ <ul class="summary">
108
+
109
+ <li class="public ">
110
+ <span class="summary_signature">
111
+
112
+ <a href="#crl-instance_method" title="#crl (instance method)">- (Object) <strong>crl</strong> </a>
113
+
114
+
115
+
116
+ </span>
117
+
118
+
119
+
120
+
121
+ <span class="note title readonly">readonly</span>
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ <span class="summary_desc"><div class='inline'>
132
+ <p>Returns the value of attribute crl.</p>
133
+ </div></span>
134
+
135
+ </li>
136
+
137
+
138
+ </ul>
139
+
140
+
141
+
142
+
143
+
144
+ <h2>
145
+ Class Method Summary
146
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
147
+ </h2>
148
+
149
+ <ul class="summary">
150
+
151
+ <li class="public ">
152
+ <span class="summary_signature">
153
+
154
+ <a href="#load_from_file-class_method" title="load_from_file (class method)">+ (R509::Crl::Parser) <strong>load_from_file</strong>(filename) </a>
155
+
156
+
157
+
158
+ </span>
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+ <span class="summary_desc"><div class='inline'>
169
+ <p>Helper method to quickly load a CRL from the filesystem.</p>
170
+ </div></span>
171
+
172
+ </li>
173
+
174
+
175
+ </ul>
176
+
177
+ <h2>
178
+ Instance Method Summary
179
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
180
+ </h2>
181
+
182
+ <ul class="summary">
183
+
184
+ <li class="public ">
185
+ <span class="summary_signature">
186
+
187
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Parser) <strong>initialize</strong>(crl) </a>
188
+
189
+
190
+
191
+ </span>
192
+
193
+
194
+ <span class="note title constructor">constructor</span>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+ <span class="summary_desc"><div class='inline'>
204
+ <p>A new instance of Parser.</p>
205
+ </div></span>
206
+
207
+ </li>
208
+
209
+
210
+ <li class="public ">
211
+ <span class="summary_signature">
212
+
213
+ <a href="#issuer-instance_method" title="#issuer (instance method)">- (OpenSSL::X509::Name) <strong>issuer</strong> </a>
214
+
215
+
216
+
217
+ </span>
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+ <span class="summary_desc"><div class='inline'></div></span>
228
+
229
+ </li>
230
+
231
+
232
+ <li class="public ">
233
+ <span class="summary_signature">
234
+
235
+ <a href="#issuer_cn-instance_method" title="#issuer_cn (instance method)">- (String) <strong>issuer_cn</strong> </a>
236
+
237
+
238
+
239
+ </span>
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+ <span class="summary_desc"><div class='inline'>
250
+ <p>The common name (CN) component of the issuer.</p>
251
+ </div></span>
252
+
253
+ </li>
254
+
255
+
256
+ <li class="public ">
257
+ <span class="summary_signature">
258
+
259
+ <a href="#last_update-instance_method" title="#last_update (instance method)">- (Time) <strong>last_update</strong> </a>
260
+
261
+
262
+
263
+ </span>
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ <span class="summary_desc"><div class='inline'></div></span>
274
+
275
+ </li>
276
+
277
+
278
+ <li class="public ">
279
+ <span class="summary_signature">
280
+
281
+ <a href="#next_update-instance_method" title="#next_update (instance method)">- (Time) <strong>next_update</strong> </a>
282
+
283
+
284
+
285
+ </span>
286
+
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+ <span class="summary_desc"><div class='inline'></div></span>
296
+
297
+ </li>
298
+
299
+
300
+ <li class="public ">
301
+ <span class="summary_signature">
302
+
303
+ <a href="#revoked-instance_method" title="#revoked (instance method)">- (Hash) <strong>revoked</strong> </a>
304
+
305
+
306
+
307
+ </span>
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+ <span class="summary_desc"><div class='inline'>
318
+ <p>Hash of serial =&gt; { :time, :reason } hashes.</p>
319
+ </div></span>
320
+
321
+ </li>
322
+
323
+
324
+ <li class="public ">
325
+ <span class="summary_signature">
326
+
327
+ <a href="#revoked%3F-instance_method" title="#revoked? (instance method)">- (Boolean) <strong>revoked?</strong>(serial) </a>
328
+
329
+
330
+
331
+ </span>
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+ <span class="summary_desc"><div class='inline'></div></span>
342
+
343
+ </li>
344
+
345
+
346
+ <li class="public ">
347
+ <span class="summary_signature">
348
+
349
+ <a href="#revoked_cert-instance_method" title="#revoked_cert (instance method)">- (Hash) <strong>revoked_cert</strong>(serial) </a>
350
+
351
+
352
+
353
+ </span>
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+ <span class="summary_desc"><div class='inline'>
364
+ <p>Hash with :time and :reason.</p>
365
+ </div></span>
366
+
367
+ </li>
368
+
369
+
370
+ <li class="public ">
371
+ <span class="summary_signature">
372
+
373
+ <a href="#signature_algorithm-instance_method" title="#signature_algorithm (instance method)">- (String) <strong>signature_algorithm</strong> </a>
374
+
375
+
376
+
377
+ </span>
378
+
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+ <span class="summary_desc"><div class='inline'></div></span>
388
+
389
+ </li>
390
+
391
+
392
+ <li class="public ">
393
+ <span class="summary_signature">
394
+
395
+ <a href="#verify-instance_method" title="#verify (instance method)">- (Boolean) <strong>verify</strong>(public_key) </a>
396
+
397
+
398
+
399
+ </span>
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
408
+
409
+ <span class="summary_desc"><div class='inline'>
410
+ <p>Pass a public key to verify that the CRL is signed by a specific
411
+ certificate (call cert.public_key on that object).</p>
412
+ </div></span>
413
+
414
+ </li>
415
+
416
+
417
+ </ul>
418
+
419
+
420
+ <div id="constructor_details" class="method_details_list">
421
+ <h2>Constructor Details</h2>
422
+
423
+ <div class="method_details first">
424
+ <h3 class="signature first" id="initialize-instance_method">
425
+
426
+ - (<tt><span class='object_link'><a href="" title="R509::Crl::Parser (class)">Parser</a></span></tt>) <strong>initialize</strong>(crl)
427
+
428
+
429
+
430
+
431
+
432
+ </h3><div class="docstring">
433
+ <div class="discussion">
434
+
435
+ <p>A new instance of Parser</p>
436
+
437
+
438
+ </div>
439
+ </div>
440
+ <div class="tags">
441
+ <p class="tag_title">Parameters:</p>
442
+ <ul class="param">
443
+
444
+ <li>
445
+
446
+ <span class='name'>crl</span>
447
+
448
+
449
+ <span class='type'>(<tt>String</tt>, <tt>OpenSSL::X509::CRL</tt>)</span>
450
+
451
+
452
+
453
+ </li>
454
+
455
+ </ul>
456
+
457
+
458
+ </div><table class="source_code">
459
+ <tr>
460
+ <td>
461
+ <pre class="lines">
462
+
463
+
464
+ 14
465
+ 15
466
+ 16</pre>
467
+ </td>
468
+ <td>
469
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 14</span>
470
+
471
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_crl'>crl</span><span class='rparen'>)</span>
472
+ <span class='ivar'>@crl</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>X509</span><span class='op'>::</span><span class='const'>CRL</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_crl'>crl</span><span class='rparen'>)</span>
473
+ <span class='kw'>end</span></pre>
474
+ </td>
475
+ </tr>
476
+ </table>
477
+ </div>
478
+
479
+ </div>
480
+
481
+ <div id="instance_attr_details" class="attr_details">
482
+ <h2>Instance Attribute Details</h2>
483
+
484
+
485
+ <span id=""></span>
486
+ <span id="crl-instance_method"></span>
487
+ <div class="method_details first">
488
+ <h3 class="signature first" id="crl-instance_method">
489
+
490
+ - (<tt>Object</tt>) <strong>crl</strong> <span class="extras">(readonly)</span>
491
+
492
+
493
+
494
+
495
+
496
+ </h3><div class="docstring">
497
+ <div class="discussion">
498
+
499
+ <p>Returns the value of attribute crl</p>
500
+
501
+
502
+ </div>
503
+ </div>
504
+ <div class="tags">
505
+
506
+
507
+ </div><table class="source_code">
508
+ <tr>
509
+ <td>
510
+ <pre class="lines">
511
+
512
+
513
+ 11
514
+ 12
515
+ 13</pre>
516
+ </td>
517
+ <td>
518
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 11</span>
519
+
520
+ <span class='kw'>def</span> <span class='id identifier rubyid_crl'>crl</span>
521
+ <span class='ivar'>@crl</span>
522
+ <span class='kw'>end</span></pre>
523
+ </td>
524
+ </tr>
525
+ </table>
526
+ </div>
527
+
528
+ </div>
529
+
530
+
531
+ <div id="class_method_details" class="method_details_list">
532
+ <h2>Class Method Details</h2>
533
+
534
+
535
+ <div class="method_details first">
536
+ <h3 class="signature first" id="load_from_file-class_method">
537
+
538
+ + (<tt><span class='object_link'><a href="" title="R509::Crl::Parser (class)">R509::Crl::Parser</a></span></tt>) <strong>load_from_file</strong>(filename)
539
+
540
+
541
+
542
+
543
+
544
+ </h3><div class="docstring">
545
+ <div class="discussion">
546
+
547
+ <p>Helper method to quickly load a CRL from the filesystem</p>
548
+
549
+
550
+ </div>
551
+ </div>
552
+ <div class="tags">
553
+ <p class="tag_title">Parameters:</p>
554
+ <ul class="param">
555
+
556
+ <li>
557
+
558
+ <span class='name'>filename</span>
559
+
560
+
561
+ <span class='type'>(<tt>String</tt>)</span>
562
+
563
+
564
+
565
+ &mdash;
566
+ <div class='inline'>
567
+ <p>Path to file you want to load</p>
568
+ </div>
569
+
570
+ </li>
571
+
572
+ </ul>
573
+
574
+ <p class="tag_title">Returns:</p>
575
+ <ul class="return">
576
+
577
+ <li>
578
+
579
+
580
+ <span class='type'>(<tt><span class='object_link'><a href="" title="R509::Crl::Parser (class)">R509::Crl::Parser</a></span></tt>)</span>
581
+
582
+
583
+
584
+ &mdash;
585
+ <div class='inline'>
586
+ <p>CRL object</p>
587
+ </div>
588
+
589
+ </li>
590
+
591
+ </ul>
592
+
593
+ </div><table class="source_code">
594
+ <tr>
595
+ <td>
596
+ <pre class="lines">
597
+
598
+
599
+ 22
600
+ 23
601
+ 24</pre>
602
+ </td>
603
+ <td>
604
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 22</span>
605
+
606
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_from_file'>load_from_file</span><span class='lparen'>(</span> <span class='id identifier rubyid_filename'>filename</span> <span class='rparen'>)</span>
607
+ <span class='kw'>return</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Crl</span><span class='op'>::</span><span class='const'>Parser</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='const'>IOHelpers</span><span class='period'>.</span><span class='id identifier rubyid_read_data'>read_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span> <span class='rparen'>)</span>
608
+ <span class='kw'>end</span></pre>
609
+ </td>
610
+ </tr>
611
+ </table>
612
+ </div>
613
+
614
+ </div>
615
+
616
+ <div id="instance_method_details" class="method_details_list">
617
+ <h2>Instance Method Details</h2>
618
+
619
+
620
+ <div class="method_details first">
621
+ <h3 class="signature first" id="issuer-instance_method">
622
+
623
+ - (<tt>OpenSSL::X509::Name</tt>) <strong>issuer</strong>
624
+
625
+
626
+
627
+
628
+
629
+ </h3><div class="docstring">
630
+ <div class="discussion">
631
+
632
+
633
+ </div>
634
+ </div>
635
+ <div class="tags">
636
+
637
+ <p class="tag_title">Returns:</p>
638
+ <ul class="return">
639
+
640
+ <li>
641
+
642
+
643
+ <span class='type'>(<tt>OpenSSL::X509::Name</tt>)</span>
644
+
645
+
646
+
647
+ </li>
648
+
649
+ </ul>
650
+
651
+ </div><table class="source_code">
652
+ <tr>
653
+ <td>
654
+ <pre class="lines">
655
+
656
+
657
+ 27
658
+ 28
659
+ 29</pre>
660
+ </td>
661
+ <td>
662
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 27</span>
663
+
664
+ <span class='kw'>def</span> <span class='id identifier rubyid_issuer'>issuer</span>
665
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_issuer'>issuer</span>
666
+ <span class='kw'>end</span></pre>
667
+ </td>
668
+ </tr>
669
+ </table>
670
+ </div>
671
+
672
+ <div class="method_details ">
673
+ <h3 class="signature " id="issuer_cn-instance_method">
674
+
675
+ - (<tt>String</tt>) <strong>issuer_cn</strong>
676
+
677
+
678
+
679
+
680
+
681
+ </h3><div class="docstring">
682
+ <div class="discussion">
683
+
684
+ <p>The common name (CN) component of the issuer</p>
685
+
686
+
687
+ </div>
688
+ </div>
689
+ <div class="tags">
690
+
691
+ <p class="tag_title">Returns:</p>
692
+ <ul class="return">
693
+
694
+ <li>
695
+
696
+
697
+ <span class='type'>(<tt>String</tt>)</span>
698
+
699
+
700
+
701
+ &mdash;
702
+ <div class='inline'>
703
+ <p>The common name (CN) component of the issuer</p>
704
+ </div>
705
+
706
+ </li>
707
+
708
+ </ul>
709
+
710
+ </div><table class="source_code">
711
+ <tr>
712
+ <td>
713
+ <pre class="lines">
714
+
715
+
716
+ 32
717
+ 33
718
+ 34
719
+ 35
720
+ 36
721
+ 37
722
+ 38
723
+ 39
724
+ 40
725
+ 41</pre>
726
+ </td>
727
+ <td>
728
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 32</span>
729
+
730
+ <span class='kw'>def</span> <span class='id identifier rubyid_issuer_cn'>issuer_cn</span>
731
+ <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_issuer'>issuer</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
732
+
733
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_issuer'>issuer</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_part'>part</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_length'>length</span><span class='op'>|</span>
734
+ <span class='kw'>return</span> <span class='id identifier rubyid_value'>value</span> <span class='kw'>if</span> <span class='id identifier rubyid_part'>part</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>CN</span><span class='tstring_end'>'</span></span>
735
+ <span class='kw'>end</span>
736
+
737
+ <span class='comment'># return nil if we didn't find a CN part
738
+ </span> <span class='kw'>return</span> <span class='kw'>nil</span>
739
+ <span class='kw'>end</span></pre>
740
+ </td>
741
+ </tr>
742
+ </table>
743
+ </div>
744
+
745
+ <div class="method_details ">
746
+ <h3 class="signature " id="last_update-instance_method">
747
+
748
+ - (<tt>Time</tt>) <strong>last_update</strong>
749
+
750
+
751
+
752
+
753
+
754
+ </h3><div class="docstring">
755
+ <div class="discussion">
756
+
757
+
758
+ </div>
759
+ </div>
760
+ <div class="tags">
761
+
762
+ <p class="tag_title">Returns:</p>
763
+ <ul class="return">
764
+
765
+ <li>
766
+
767
+
768
+ <span class='type'>(<tt>Time</tt>)</span>
769
+
770
+
771
+
772
+ </li>
773
+
774
+ </ul>
775
+
776
+ </div><table class="source_code">
777
+ <tr>
778
+ <td>
779
+ <pre class="lines">
780
+
781
+
782
+ 44
783
+ 45
784
+ 46</pre>
785
+ </td>
786
+ <td>
787
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 44</span>
788
+
789
+ <span class='kw'>def</span> <span class='id identifier rubyid_last_update'>last_update</span>
790
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_last_update'>last_update</span>
791
+ <span class='kw'>end</span></pre>
792
+ </td>
793
+ </tr>
794
+ </table>
795
+ </div>
796
+
797
+ <div class="method_details ">
798
+ <h3 class="signature " id="next_update-instance_method">
799
+
800
+ - (<tt>Time</tt>) <strong>next_update</strong>
801
+
802
+
803
+
804
+
805
+
806
+ </h3><div class="docstring">
807
+ <div class="discussion">
808
+
809
+
810
+ </div>
811
+ </div>
812
+ <div class="tags">
813
+
814
+ <p class="tag_title">Returns:</p>
815
+ <ul class="return">
816
+
817
+ <li>
818
+
819
+
820
+ <span class='type'>(<tt>Time</tt>)</span>
821
+
822
+
823
+
824
+ </li>
825
+
826
+ </ul>
827
+
828
+ </div><table class="source_code">
829
+ <tr>
830
+ <td>
831
+ <pre class="lines">
832
+
833
+
834
+ 49
835
+ 50
836
+ 51</pre>
837
+ </td>
838
+ <td>
839
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 49</span>
840
+
841
+ <span class='kw'>def</span> <span class='id identifier rubyid_next_update'>next_update</span>
842
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_next_update'>next_update</span>
843
+ <span class='kw'>end</span></pre>
844
+ </td>
845
+ </tr>
846
+ </table>
847
+ </div>
848
+
849
+ <div class="method_details ">
850
+ <h3 class="signature " id="revoked-instance_method">
851
+
852
+ - (<tt>Hash</tt>) <strong>revoked</strong>
853
+
854
+
855
+
856
+
857
+
858
+ </h3><div class="docstring">
859
+ <div class="discussion">
860
+
861
+ <p>Hash of serial =&gt; { :time, :reason } hashes</p>
862
+
863
+
864
+ </div>
865
+ </div>
866
+ <div class="tags">
867
+
868
+ <p class="tag_title">Returns:</p>
869
+ <ul class="return">
870
+
871
+ <li>
872
+
873
+
874
+ <span class='type'>(<tt>Hash</tt>)</span>
875
+
876
+
877
+
878
+ &mdash;
879
+ <div class='inline'>
880
+ <p>hash of serial =&gt; { :time, :reason } hashes</p>
881
+ </div>
882
+
883
+ </li>
884
+
885
+ </ul>
886
+
887
+ </div><table class="source_code">
888
+ <tr>
889
+ <td>
890
+ <pre class="lines">
891
+
892
+
893
+ 77
894
+ 78
895
+ 79
896
+ 80
897
+ 81
898
+ 82
899
+ 83
900
+ 84
901
+ 85</pre>
902
+ </td>
903
+ <td>
904
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 77</span>
905
+
906
+ <span class='kw'>def</span> <span class='id identifier rubyid_revoked'>revoked</span>
907
+ <span class='id identifier rubyid_revoked_list'>revoked_list</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
908
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_revoked'>revoked</span><span class='op'>|</span>
909
+ <span class='id identifier rubyid_reason'>reason</span> <span class='op'>=</span> <span class='id identifier rubyid_get_reason'>get_reason</span><span class='lparen'>(</span><span class='id identifier rubyid_revoked'>revoked</span><span class='rparen'>)</span>
910
+ <span class='id identifier rubyid_revoked_list'>revoked_list</span><span class='lbracket'>[</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:time</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_time'>time</span><span class='comma'>,</span> <span class='symbol'>:reason</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_reason'>reason</span> <span class='rbrace'>}</span>
911
+ <span class='kw'>end</span>
912
+
913
+ <span class='id identifier rubyid_revoked_list'>revoked_list</span>
914
+ <span class='kw'>end</span></pre>
915
+ </td>
916
+ </tr>
917
+ </table>
918
+ </div>
919
+
920
+ <div class="method_details ">
921
+ <h3 class="signature " id="revoked?-instance_method">
922
+
923
+ - (<tt>Boolean</tt>) <strong>revoked?</strong>(serial)
924
+
925
+
926
+
927
+
928
+
929
+ </h3><div class="docstring">
930
+ <div class="discussion">
931
+
932
+
933
+ </div>
934
+ </div>
935
+ <div class="tags">
936
+ <p class="tag_title">Parameters:</p>
937
+ <ul class="param">
938
+
939
+ <li>
940
+
941
+ <span class='name'>serial</span>
942
+
943
+
944
+ <span class='type'>(<tt>Integer</tt>)</span>
945
+
946
+
947
+
948
+ &mdash;
949
+ <div class='inline'>
950
+ <p>number</p>
951
+ </div>
952
+
953
+ </li>
954
+
955
+ </ul>
956
+
957
+ <p class="tag_title">Returns:</p>
958
+ <ul class="return">
959
+
960
+ <li>
961
+
962
+
963
+ <span class='type'>(<tt>Boolean</tt>)</span>
964
+
965
+
966
+
967
+ </li>
968
+
969
+ </ul>
970
+
971
+ </div><table class="source_code">
972
+ <tr>
973
+ <td>
974
+ <pre class="lines">
975
+
976
+
977
+ 68
978
+ 69
979
+ 70
980
+ 71
981
+ 72
982
+ 73
983
+ 74</pre>
984
+ </td>
985
+ <td>
986
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 68</span>
987
+
988
+ <span class='kw'>def</span> <span class='id identifier rubyid_revoked?'>revoked?</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
989
+ <span class='kw'>if</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_revoked'>revoked</span><span class='op'>|</span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span> <span class='op'>==</span> <span class='id identifier rubyid_serial'>serial</span> <span class='rbrace'>}</span>
990
+ <span class='kw'>true</span>
991
+ <span class='kw'>else</span>
992
+ <span class='kw'>false</span>
993
+ <span class='kw'>end</span>
994
+ <span class='kw'>end</span></pre>
995
+ </td>
996
+ </tr>
997
+ </table>
998
+ </div>
999
+
1000
+ <div class="method_details ">
1001
+ <h3 class="signature " id="revoked_cert-instance_method">
1002
+
1003
+ - (<tt>Hash</tt>) <strong>revoked_cert</strong>(serial)
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+ </h3><div class="docstring">
1010
+ <div class="discussion">
1011
+
1012
+ <p>Hash with :time and :reason</p>
1013
+
1014
+
1015
+ </div>
1016
+ </div>
1017
+ <div class="tags">
1018
+ <p class="tag_title">Parameters:</p>
1019
+ <ul class="param">
1020
+
1021
+ <li>
1022
+
1023
+ <span class='name'>serial</span>
1024
+
1025
+
1026
+ <span class='type'>(<tt>Integer</tt>)</span>
1027
+
1028
+
1029
+
1030
+ &mdash;
1031
+ <div class='inline'>
1032
+ <p>number</p>
1033
+ </div>
1034
+
1035
+ </li>
1036
+
1037
+ </ul>
1038
+
1039
+ <p class="tag_title">Returns:</p>
1040
+ <ul class="return">
1041
+
1042
+ <li>
1043
+
1044
+
1045
+ <span class='type'>(<tt>Hash</tt>)</span>
1046
+
1047
+
1048
+
1049
+ &mdash;
1050
+ <div class='inline'>
1051
+ <p>hash with :time and :reason</p>
1052
+ </div>
1053
+
1054
+ </li>
1055
+
1056
+ </ul>
1057
+
1058
+ </div><table class="source_code">
1059
+ <tr>
1060
+ <td>
1061
+ <pre class="lines">
1062
+
1063
+
1064
+ 89
1065
+ 90
1066
+ 91
1067
+ 92
1068
+ 93
1069
+ 94
1070
+ 95
1071
+ 96
1072
+ 97</pre>
1073
+ </td>
1074
+ <td>
1075
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 89</span>
1076
+
1077
+ <span class='kw'>def</span> <span class='id identifier rubyid_revoked_cert'>revoked_cert</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
1078
+ <span class='id identifier rubyid_revoked'>revoked</span> <span class='op'>=</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_revoked'>revoked</span><span class='op'>|</span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span> <span class='op'>==</span> <span class='id identifier rubyid_serial'>serial</span> <span class='rbrace'>}</span>
1079
+ <span class='kw'>if</span> <span class='id identifier rubyid_revoked'>revoked</span>
1080
+ <span class='id identifier rubyid_reason'>reason</span> <span class='op'>=</span> <span class='id identifier rubyid_get_reason'>get_reason</span><span class='lparen'>(</span><span class='id identifier rubyid_revoked'>revoked</span><span class='rparen'>)</span>
1081
+ <span class='lbrace'>{</span> <span class='symbol'>:time</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_time'>time</span><span class='comma'>,</span> <span class='symbol'>:reason</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_reason'>reason</span> <span class='rbrace'>}</span>
1082
+ <span class='kw'>else</span>
1083
+ <span class='kw'>nil</span>
1084
+ <span class='kw'>end</span>
1085
+ <span class='kw'>end</span></pre>
1086
+ </td>
1087
+ </tr>
1088
+ </table>
1089
+ </div>
1090
+
1091
+ <div class="method_details ">
1092
+ <h3 class="signature " id="signature_algorithm-instance_method">
1093
+
1094
+ - (<tt>String</tt>) <strong>signature_algorithm</strong>
1095
+
1096
+
1097
+
1098
+
1099
+
1100
+ </h3><div class="docstring">
1101
+ <div class="discussion">
1102
+
1103
+
1104
+ </div>
1105
+ </div>
1106
+ <div class="tags">
1107
+
1108
+ <p class="tag_title">Returns:</p>
1109
+ <ul class="return">
1110
+
1111
+ <li>
1112
+
1113
+
1114
+ <span class='type'>(<tt>String</tt>)</span>
1115
+
1116
+
1117
+
1118
+ </li>
1119
+
1120
+ </ul>
1121
+
1122
+ </div><table class="source_code">
1123
+ <tr>
1124
+ <td>
1125
+ <pre class="lines">
1126
+
1127
+
1128
+ 54
1129
+ 55
1130
+ 56</pre>
1131
+ </td>
1132
+ <td>
1133
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 54</span>
1134
+
1135
+ <span class='kw'>def</span> <span class='id identifier rubyid_signature_algorithm'>signature_algorithm</span>
1136
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_signature_algorithm'>signature_algorithm</span>
1137
+ <span class='kw'>end</span></pre>
1138
+ </td>
1139
+ </tr>
1140
+ </table>
1141
+ </div>
1142
+
1143
+ <div class="method_details ">
1144
+ <h3 class="signature " id="verify-instance_method">
1145
+
1146
+ - (<tt>Boolean</tt>) <strong>verify</strong>(public_key)
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+ </h3><div class="docstring">
1153
+ <div class="discussion">
1154
+
1155
+ <p>Pass a public key to verify that the CRL is signed by a specific
1156
+ certificate (call cert.public_key on that object)</p>
1157
+
1158
+
1159
+ </div>
1160
+ </div>
1161
+ <div class="tags">
1162
+ <p class="tag_title">Parameters:</p>
1163
+ <ul class="param">
1164
+
1165
+ <li>
1166
+
1167
+ <span class='name'>public_key</span>
1168
+
1169
+
1170
+ <span class='type'>(<tt>OpenSSL::PKey::PKey</tt>)</span>
1171
+
1172
+
1173
+
1174
+ </li>
1175
+
1176
+ </ul>
1177
+
1178
+ <p class="tag_title">Returns:</p>
1179
+ <ul class="return">
1180
+
1181
+ <li>
1182
+
1183
+
1184
+ <span class='type'>(<tt>Boolean</tt>)</span>
1185
+
1186
+
1187
+
1188
+ </li>
1189
+
1190
+ </ul>
1191
+
1192
+ </div><table class="source_code">
1193
+ <tr>
1194
+ <td>
1195
+ <pre class="lines">
1196
+
1197
+
1198
+ 62
1199
+ 63
1200
+ 64</pre>
1201
+ </td>
1202
+ <td>
1203
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 62</span>
1204
+
1205
+ <span class='kw'>def</span> <span class='id identifier rubyid_verify'>verify</span><span class='lparen'>(</span><span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
1206
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='lparen'>(</span><span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
1207
+ <span class='kw'>end</span></pre>
1208
+ </td>
1209
+ </tr>
1210
+ </table>
1211
+ </div>
1212
+
1213
+ </div>
1214
+
1215
+ </div>
1216
+
1217
+ <div id="footer">
1218
+ Generated on Tue Oct 23 22:48:01 2012 by
1219
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1220
+ 0.8.0 (ruby-1.9.3).
1221
+ </div>
1222
+
1223
+ </body>
1224
+ </html>