r509 0.8

Sign up to get free protection for your applications and to get access to all the features.
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
data/doc/R509/Crl.html ADDED
@@ -0,0 +1,126 @@
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
+ Module: R509::Crl
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 (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../R509.html" title="R509 (module)">R509</a></span></span>
36
+ &raquo;
37
+ <span class="title">Crl</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>Module: R509::Crl
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/r509/crl.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+
90
+ <p>contains CRL related classes (generator and a pre-existing list loader)</p>
91
+
92
+
93
+ </div>
94
+ </div>
95
+ <div class="tags">
96
+
97
+
98
+ </div><h2>Defined Under Namespace</h2>
99
+ <p class="children">
100
+
101
+
102
+
103
+
104
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Crl/Administrator.html" title="R509::Crl::Administrator (class)">Administrator</a></span>, <span class='object_link'><a href="Crl/Parser.html" title="R509::Crl::Parser (class)">Parser</a></span>
105
+
106
+
107
+ </p>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ </div>
118
+
119
+ <div id="footer">
120
+ Generated on Tue Oct 23 22:48:01 2012 by
121
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
122
+ 0.8.0 (ruby-1.9.3).
123
+ </div>
124
+
125
+ </body>
126
+ </html>
@@ -0,0 +1,2077 @@
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::Administrator
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 (A)</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">Administrator</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::Administrator
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::Administrator</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2"><span class='object_link'><a href="../IOHelpers.html" title="R509::IOHelpers (module)">IOHelpers</a></span></dd>
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/r509/crl.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>Used to manage revocations and generate CRLs</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#crl_list_file-instance_method" title="#crl_list_file (instance method)">- (Object) <strong>crl_list_file</strong> </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+ <span class="note title readonly">readonly</span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>Returns the value of attribute crl_list_file.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ <li class="public ">
154
+ <span class="summary_signature">
155
+
156
+ <a href="#crl_number-instance_method" title="#crl_number (instance method)">- (Object) <strong>crl_number</strong> </a>
157
+
158
+
159
+
160
+ </span>
161
+
162
+
163
+
164
+
165
+ <span class="note title readonly">readonly</span>
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <span class="summary_desc"><div class='inline'>
176
+ <p>Returns the value of attribute crl_number.</p>
177
+ </div></span>
178
+
179
+ </li>
180
+
181
+
182
+ <li class="public ">
183
+ <span class="summary_signature">
184
+
185
+ <a href="#crl_number_file-instance_method" title="#crl_number_file (instance method)">- (Object) <strong>crl_number_file</strong> </a>
186
+
187
+
188
+
189
+ </span>
190
+
191
+
192
+
193
+
194
+ <span class="note title readonly">readonly</span>
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+ <span class="summary_desc"><div class='inline'>
205
+ <p>Returns the value of attribute crl_number_file.</p>
206
+ </div></span>
207
+
208
+ </li>
209
+
210
+
211
+ <li class="public ">
212
+ <span class="summary_signature">
213
+
214
+ <a href="#validity_hours-instance_method" title="#validity_hours (instance method)">- (Object) <strong>validity_hours</strong> </a>
215
+
216
+
217
+
218
+ </span>
219
+
220
+
221
+
222
+
223
+ <span class="note title readonly">readonly</span>
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+ <span class="summary_desc"><div class='inline'>
234
+ <p>Returns the value of attribute validity_hours.</p>
235
+ </div></span>
236
+
237
+ </li>
238
+
239
+
240
+ </ul>
241
+
242
+
243
+
244
+
245
+
246
+ <h2>
247
+ Instance Method Summary
248
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
249
+ </h2>
250
+
251
+ <ul class="summary">
252
+
253
+ <li class="public ">
254
+ <span class="summary_signature">
255
+
256
+ <a href="#generate_crl-instance_method" title="#generate_crl (instance method)">- (String) <strong>generate_crl</strong> </a>
257
+
258
+
259
+
260
+ </span>
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+ <span class="summary_desc"><div class='inline'>
271
+ <p>Remove serial from revocation list.</p>
272
+ </div></span>
273
+
274
+ </li>
275
+
276
+
277
+ <li class="public ">
278
+ <span class="summary_signature">
279
+
280
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Administrator) <strong>initialize</strong>(config) </a>
281
+
282
+
283
+
284
+ </span>
285
+
286
+
287
+ <span class="note title constructor">constructor</span>
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+ <span class="summary_desc"><div class='inline'>
297
+ <p>A new instance of Administrator.</p>
298
+ </div></span>
299
+
300
+ </li>
301
+
302
+
303
+ <li class="public ">
304
+ <span class="summary_signature">
305
+
306
+ <a href="#last_update-instance_method" title="#last_update (instance method)">- (Time) <strong>last_update</strong> </a>
307
+
308
+
309
+
310
+ </span>
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+ <span class="summary_desc"><div class='inline'>
321
+ <p>Returns the signing time of the CRL.</p>
322
+ </div></span>
323
+
324
+ </li>
325
+
326
+
327
+ <li class="public ">
328
+ <span class="summary_signature">
329
+
330
+ <a href="#next_update-instance_method" title="#next_update (instance method)">- (Time) <strong>next_update</strong> </a>
331
+
332
+
333
+
334
+ </span>
335
+
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
344
+ <span class="summary_desc"><div class='inline'>
345
+ <p>Returns the next update time for the CRL.</p>
346
+ </div></span>
347
+
348
+ </li>
349
+
350
+
351
+ <li class="public ">
352
+ <span class="summary_signature">
353
+
354
+ <a href="#revoke_cert-instance_method" title="#revoke_cert (instance method)">- (Object) <strong>revoke_cert</strong>(serial, reason = nil, revoke_time = Time.now.to_i, generate_and_save = true) </a>
355
+
356
+
357
+
358
+ </span>
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+ <span class="summary_desc"><div class='inline'>
369
+ <p>Adds a certificate to the revocation list.</p>
370
+ </div></span>
371
+
372
+ </li>
373
+
374
+
375
+ <li class="public ">
376
+ <span class="summary_signature">
377
+
378
+ <a href="#revoked%3F-instance_method" title="#revoked? (instance method)">- (Boolean) <strong>revoked?</strong>(serial) </a>
379
+
380
+
381
+
382
+ </span>
383
+
384
+
385
+
386
+
387
+
388
+
389
+
390
+
391
+
392
+ <span class="summary_desc"><div class='inline'>
393
+ <p>Indicates whether the serial number has been revoked, or not.</p>
394
+ </div></span>
395
+
396
+ </li>
397
+
398
+
399
+ <li class="public ">
400
+ <span class="summary_signature">
401
+
402
+ <a href="#revoked_cert-instance_method" title="#revoked_cert (instance method)">- (Array) <strong>revoked_cert</strong>(serial) </a>
403
+
404
+
405
+
406
+ </span>
407
+
408
+
409
+
410
+
411
+
412
+
413
+
414
+
415
+
416
+ <span class="summary_desc"><div class='inline'>
417
+ <p>Serial, reason, revoke_time tuple.</p>
418
+ </div></span>
419
+
420
+ </li>
421
+
422
+
423
+ <li class="public ">
424
+ <span class="summary_signature">
425
+
426
+ <a href="#revoked_certs-instance_method" title="#revoked_certs (instance method)">- (Array&lt;Array&gt;) <strong>revoked_certs</strong> </a>
427
+
428
+
429
+
430
+ </span>
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+ <span class="summary_desc"><div class='inline'>
441
+ <p>Returns an array of serial, reason, revoke_time tuples.</p>
442
+ </div></span>
443
+
444
+ </li>
445
+
446
+
447
+ <li class="public ">
448
+ <span class="summary_signature">
449
+
450
+ <a href="#save_crl_list-instance_method" title="#save_crl_list (instance method)">- (Object) <strong>save_crl_list</strong>(filename_or_io = @crl_list_file) </a>
451
+
452
+
453
+
454
+ </span>
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+ <span class="summary_desc"><div class='inline'>
465
+ <p>Saves the CRL list to a filename or IO.</p>
466
+ </div></span>
467
+
468
+ </li>
469
+
470
+
471
+ <li class="public ">
472
+ <span class="summary_signature">
473
+
474
+ <a href="#save_crl_number-instance_method" title="#save_crl_number (instance method)">- (Object) <strong>save_crl_number</strong>(filename_or_io = @crl_number_file) </a>
475
+
476
+
477
+
478
+ </span>
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+ <span class="summary_desc"><div class='inline'>
489
+ <p>Save the CRL number to a filename or IO.</p>
490
+ </div></span>
491
+
492
+ </li>
493
+
494
+
495
+ <li class="public ">
496
+ <span class="summary_signature">
497
+
498
+ <a href="#to_crl-instance_method" title="#to_crl (instance method)">- (R509::Crl::Parser) <strong>to_crl</strong> </a>
499
+
500
+
501
+
502
+ </span>
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+ <span class="summary_desc"><div class='inline'></div></span>
513
+
514
+ </li>
515
+
516
+
517
+ <li class="public ">
518
+ <span class="summary_signature">
519
+
520
+ <a href="#to_der-instance_method" title="#to_der (instance method)">- (String) <strong>to_der</strong> </a>
521
+
522
+
523
+
524
+ </span>
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+
533
+
534
+ <span class="summary_desc"><div class='inline'>
535
+ <p>Returns the CRL in DER format.</p>
536
+ </div></span>
537
+
538
+ </li>
539
+
540
+
541
+ <li class="public ">
542
+ <span class="summary_signature">
543
+
544
+ <a href="#to_pem-instance_method" title="#to_pem (instance method)">- (String) <strong>to_pem</strong> </a>
545
+
546
+
547
+
548
+ (also: #to_s)
549
+
550
+ </span>
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+ <span class="summary_desc"><div class='inline'>
561
+ <p>Returns the CRL in PEM format.</p>
562
+ </div></span>
563
+
564
+ </li>
565
+
566
+
567
+ <li class="public ">
568
+ <span class="summary_signature">
569
+
570
+ <a href="#unrevoke_cert-instance_method" title="#unrevoke_cert (instance method)">- (Object) <strong>unrevoke_cert</strong>(serial) </a>
571
+
572
+
573
+
574
+ </span>
575
+
576
+
577
+
578
+
579
+
580
+
581
+
582
+
583
+
584
+ <span class="summary_desc"><div class='inline'>
585
+ <p>Remove serial from revocation list.</p>
586
+ </div></span>
587
+
588
+ </li>
589
+
590
+
591
+ <li class="public ">
592
+ <span class="summary_signature">
593
+
594
+ <a href="#write_der-instance_method" title="#write_der (instance method)">- (Object) <strong>write_der</strong>(filename_or_io) </a>
595
+
596
+
597
+
598
+ </span>
599
+
600
+
601
+
602
+
603
+
604
+
605
+
606
+
607
+
608
+ <span class="summary_desc"><div class='inline'>
609
+ <p>Writes the CRL into the PEM format.</p>
610
+ </div></span>
611
+
612
+ </li>
613
+
614
+
615
+ <li class="public ">
616
+ <span class="summary_signature">
617
+
618
+ <a href="#write_pem-instance_method" title="#write_pem (instance method)">- (Object) <strong>write_pem</strong>(filename_or_io) </a>
619
+
620
+
621
+
622
+ </span>
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+ <span class="summary_desc"><div class='inline'>
633
+ <p>Writes the CRL into the PEM format.</p>
634
+ </div></span>
635
+
636
+ </li>
637
+
638
+
639
+ </ul>
640
+
641
+
642
+
643
+
644
+
645
+
646
+
647
+
648
+
649
+
650
+
651
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../IOHelpers.html" title="R509::IOHelpers (module)">IOHelpers</a></span></h3>
652
+ <p class="inherited"><span class='object_link'><a href="../IOHelpers.html#read_data-instance_method" title="R509::IOHelpers#read_data (method)">#read_data</a></span>, <span class='object_link'><a href="../IOHelpers.html#read_data-class_method" title="R509::IOHelpers.read_data (method)">read_data</a></span>, <span class='object_link'><a href="../IOHelpers.html#write_data-instance_method" title="R509::IOHelpers#write_data (method)">#write_data</a></span>, <span class='object_link'><a href="../IOHelpers.html#write_data-class_method" title="R509::IOHelpers.write_data (method)">write_data</a></span></p>
653
+ <div id="constructor_details" class="method_details_list">
654
+ <h2>Constructor Details</h2>
655
+
656
+ <div class="method_details first">
657
+ <h3 class="signature first" id="initialize-instance_method">
658
+
659
+ - (<tt><span class='object_link'><a href="" title="R509::Crl::Administrator (class)">Administrator</a></span></tt>) <strong>initialize</strong>(config)
660
+
661
+
662
+
663
+
664
+
665
+ </h3><div class="docstring">
666
+ <div class="discussion">
667
+
668
+ <p>A new instance of Administrator</p>
669
+
670
+
671
+ </div>
672
+ </div>
673
+ <div class="tags">
674
+ <p class="tag_title">Parameters:</p>
675
+ <ul class="param">
676
+
677
+ <li>
678
+
679
+ <span class='name'>config</span>
680
+
681
+
682
+ <span class='type'>(<tt><span class='object_link'><a href="../Config/CaConfig.html" title="R509::Config::CaConfig (class)">R509::Config::CaConfig</a></span></tt>)</span>
683
+
684
+
685
+
686
+ </li>
687
+
688
+ </ul>
689
+
690
+
691
+ </div><table class="source_code">
692
+ <tr>
693
+ <td>
694
+ <pre class="lines">
695
+
696
+
697
+ 119
698
+ 120
699
+ 121
700
+ 122
701
+ 123
702
+ 124
703
+ 125
704
+ 126
705
+ 127
706
+ 128
707
+ 129
708
+ 130
709
+ 131
710
+ 132
711
+ 133
712
+ 134
713
+ 135
714
+ 136
715
+ 137
716
+ 138
717
+ 139
718
+ 140</pre>
719
+ </td>
720
+ <td>
721
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 119</span>
722
+
723
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
724
+ <span class='ivar'>@config</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span>
725
+
726
+ <span class='kw'>unless</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>R509</span><span class='op'>::</span><span class='const'>Config</span><span class='op'>::</span><span class='const'>CaConfig</span><span class='rparen'>)</span>
727
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>config must be a kind of R509::Config::CaConfig</span><span class='tstring_end'>&quot;</span></span>
728
+ <span class='kw'>end</span>
729
+
730
+ <span class='ivar'>@validity_hours</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_crl_validity_hours'>crl_validity_hours</span>
731
+ <span class='ivar'>@start_skew_seconds</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_crl_start_skew_seconds'>crl_start_skew_seconds</span>
732
+ <span class='ivar'>@crl</span> <span class='op'>=</span> <span class='kw'>nil</span>
733
+
734
+ <span class='ivar'>@crl_number_file</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_crl_number_file'>crl_number_file</span>
735
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='ivar'>@crl_number_file</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
736
+ <span class='ivar'>@crl_number</span> <span class='op'>=</span> <span class='id identifier rubyid_read_data'>read_data</span><span class='lparen'>(</span><span class='ivar'>@crl_number_file</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
737
+ <span class='kw'>else</span>
738
+ <span class='ivar'>@crl_number</span> <span class='op'>=</span> <span class='int'>0</span>
739
+ <span class='kw'>end</span>
740
+
741
+
742
+ <span class='ivar'>@crl_list_file</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_crl_list_file'>crl_list_file</span>
743
+ <span class='id identifier rubyid_load_crl_list'>load_crl_list</span><span class='lparen'>(</span><span class='ivar'>@crl_list_file</span><span class='rparen'>)</span>
744
+ <span class='kw'>end</span></pre>
745
+ </td>
746
+ </tr>
747
+ </table>
748
+ </div>
749
+
750
+ </div>
751
+
752
+ <div id="instance_attr_details" class="attr_details">
753
+ <h2>Instance Attribute Details</h2>
754
+
755
+
756
+ <span id=""></span>
757
+ <span id="crl_list_file-instance_method"></span>
758
+ <div class="method_details first">
759
+ <h3 class="signature first" id="crl_list_file-instance_method">
760
+
761
+ - (<tt>Object</tt>) <strong>crl_list_file</strong> <span class="extras">(readonly)</span>
762
+
763
+
764
+
765
+
766
+
767
+ </h3><div class="docstring">
768
+ <div class="discussion">
769
+
770
+ <p>Returns the value of attribute crl_list_file</p>
771
+
772
+
773
+ </div>
774
+ </div>
775
+ <div class="tags">
776
+
777
+
778
+ </div><table class="source_code">
779
+ <tr>
780
+ <td>
781
+ <pre class="lines">
782
+
783
+
784
+ 116
785
+ 117
786
+ 118</pre>
787
+ </td>
788
+ <td>
789
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 116</span>
790
+
791
+ <span class='kw'>def</span> <span class='id identifier rubyid_crl_list_file'>crl_list_file</span>
792
+ <span class='ivar'>@crl_list_file</span>
793
+ <span class='kw'>end</span></pre>
794
+ </td>
795
+ </tr>
796
+ </table>
797
+ </div>
798
+
799
+
800
+ <span id=""></span>
801
+ <span id="crl_number-instance_method"></span>
802
+ <div class="method_details ">
803
+ <h3 class="signature " id="crl_number-instance_method">
804
+
805
+ - (<tt>Object</tt>) <strong>crl_number</strong> <span class="extras">(readonly)</span>
806
+
807
+
808
+
809
+
810
+
811
+ </h3><div class="docstring">
812
+ <div class="discussion">
813
+
814
+ <p>Returns the value of attribute crl_number</p>
815
+
816
+
817
+ </div>
818
+ </div>
819
+ <div class="tags">
820
+
821
+
822
+ </div><table class="source_code">
823
+ <tr>
824
+ <td>
825
+ <pre class="lines">
826
+
827
+
828
+ 116
829
+ 117
830
+ 118</pre>
831
+ </td>
832
+ <td>
833
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 116</span>
834
+
835
+ <span class='kw'>def</span> <span class='id identifier rubyid_crl_number'>crl_number</span>
836
+ <span class='ivar'>@crl_number</span>
837
+ <span class='kw'>end</span></pre>
838
+ </td>
839
+ </tr>
840
+ </table>
841
+ </div>
842
+
843
+
844
+ <span id=""></span>
845
+ <span id="crl_number_file-instance_method"></span>
846
+ <div class="method_details ">
847
+ <h3 class="signature " id="crl_number_file-instance_method">
848
+
849
+ - (<tt>Object</tt>) <strong>crl_number_file</strong> <span class="extras">(readonly)</span>
850
+
851
+
852
+
853
+
854
+
855
+ </h3><div class="docstring">
856
+ <div class="discussion">
857
+
858
+ <p>Returns the value of attribute crl_number_file</p>
859
+
860
+
861
+ </div>
862
+ </div>
863
+ <div class="tags">
864
+
865
+
866
+ </div><table class="source_code">
867
+ <tr>
868
+ <td>
869
+ <pre class="lines">
870
+
871
+
872
+ 116
873
+ 117
874
+ 118</pre>
875
+ </td>
876
+ <td>
877
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 116</span>
878
+
879
+ <span class='kw'>def</span> <span class='id identifier rubyid_crl_number_file'>crl_number_file</span>
880
+ <span class='ivar'>@crl_number_file</span>
881
+ <span class='kw'>end</span></pre>
882
+ </td>
883
+ </tr>
884
+ </table>
885
+ </div>
886
+
887
+
888
+ <span id=""></span>
889
+ <span id="validity_hours-instance_method"></span>
890
+ <div class="method_details ">
891
+ <h3 class="signature " id="validity_hours-instance_method">
892
+
893
+ - (<tt>Object</tt>) <strong>validity_hours</strong> <span class="extras">(readonly)</span>
894
+
895
+
896
+
897
+
898
+
899
+ </h3><div class="docstring">
900
+ <div class="discussion">
901
+
902
+ <p>Returns the value of attribute validity_hours</p>
903
+
904
+
905
+ </div>
906
+ </div>
907
+ <div class="tags">
908
+
909
+
910
+ </div><table class="source_code">
911
+ <tr>
912
+ <td>
913
+ <pre class="lines">
914
+
915
+
916
+ 116
917
+ 117
918
+ 118</pre>
919
+ </td>
920
+ <td>
921
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 116</span>
922
+
923
+ <span class='kw'>def</span> <span class='id identifier rubyid_validity_hours'>validity_hours</span>
924
+ <span class='ivar'>@validity_hours</span>
925
+ <span class='kw'>end</span></pre>
926
+ </td>
927
+ </tr>
928
+ </table>
929
+ </div>
930
+
931
+ </div>
932
+
933
+
934
+ <div id="instance_method_details" class="method_details_list">
935
+ <h2>Instance Method Details</h2>
936
+
937
+
938
+ <div class="method_details first">
939
+ <h3 class="signature first" id="generate_crl-instance_method">
940
+
941
+ - (<tt>String</tt>) <strong>generate_crl</strong>
942
+
943
+
944
+
945
+
946
+
947
+ </h3><div class="docstring">
948
+ <div class="discussion">
949
+
950
+ <p>Remove serial from revocation list</p>
951
+
952
+
953
+ </div>
954
+ </div>
955
+ <div class="tags">
956
+
957
+ <p class="tag_title">Returns:</p>
958
+ <ul class="return">
959
+
960
+ <li>
961
+
962
+
963
+ <span class='type'>(<tt>String</tt>)</span>
964
+
965
+
966
+
967
+ &mdash;
968
+ <div class='inline'>
969
+ <p>PEM encoded signed CRL</p>
970
+ </div>
971
+
972
+ </li>
973
+
974
+ </ul>
975
+
976
+ </div><table class="source_code">
977
+ <tr>
978
+ <td>
979
+ <pre class="lines">
980
+
981
+
982
+ 258
983
+ 259
984
+ 260
985
+ 261
986
+ 262
987
+ 263
988
+ 264
989
+ 265
990
+ 266
991
+ 267
992
+ 268
993
+ 269
994
+ 270
995
+ 271
996
+ 272
997
+ 273
998
+ 274
999
+ 275
1000
+ 276
1001
+ 277
1002
+ 278
1003
+ 279
1004
+ 280
1005
+ 281
1006
+ 282
1007
+ 283
1008
+ 284
1009
+ 285
1010
+ 286
1011
+ 287
1012
+ 288
1013
+ 289
1014
+ 290
1015
+ 291
1016
+ 292
1017
+ 293
1018
+ 294</pre>
1019
+ </td>
1020
+ <td>
1021
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 258</span>
1022
+
1023
+ <span class='kw'>def</span> <span class='id identifier rubyid_generate_crl'>generate_crl</span>
1024
+ <span class='id identifier rubyid_crl'>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>
1025
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='int'>1</span>
1026
+ <span class='id identifier rubyid_now'>now</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1027
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_last_update'>last_update</span> <span class='op'>=</span> <span class='id identifier rubyid_now'>now</span><span class='op'>-</span><span class='ivar'>@start_skew_seconds</span>
1028
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_next_update'>next_update</span> <span class='op'>=</span> <span class='id identifier rubyid_now'>now</span><span class='op'>+</span><span class='ivar'>@validity_hours</span><span class='op'>*</span><span class='int'>3600</span>
1029
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_issuer'>issuer</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_ca_cert'>ca_cert</span><span class='period'>.</span><span class='id identifier rubyid_subject'>subject</span>
1030
+
1031
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_revoked_certs'>revoked_certs</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_serial'>serial</span><span class='comma'>,</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span> <span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='op'>|</span>
1032
+ <span class='id identifier rubyid_revoked'>revoked</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'>Revoked</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1033
+ <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='const'>OpenSSL</span><span class='op'>::</span><span class='const'>BN</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_serial'>serial</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
1034
+ <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_time'>time</span> <span class='op'>=</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_at'>at</span><span class='lparen'>(</span><span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='rparen'>)</span>
1035
+ <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_reason'>reason</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1036
+ <span class='id identifier rubyid_enum'>enum</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>ASN1</span><span class='op'>::</span><span class='const'>Enumerated</span><span class='lparen'>(</span><span class='id identifier rubyid_reason'>reason</span><span class='rparen'>)</span> <span class='comment'>#see reason codes below
1037
+ </span> <span class='id identifier rubyid_ext'>ext</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'>Extension</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CRLReason</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_enum'>enum</span><span class='rparen'>)</span>
1038
+ <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_add_extension'>add_extension</span><span class='lparen'>(</span><span class='id identifier rubyid_ext'>ext</span><span class='rparen'>)</span>
1039
+ <span class='kw'>end</span>
1040
+ <span class='comment'>#now add it to the crl
1041
+ </span> <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_add_revoked'>add_revoked</span><span class='lparen'>(</span><span class='id identifier rubyid_revoked'>revoked</span><span class='rparen'>)</span>
1042
+ <span class='kw'>end</span>
1043
+
1044
+ <span class='id identifier rubyid_ef'>ef</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'>ExtensionFactory</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
1045
+ <span class='id identifier rubyid_ef'>ef</span><span class='period'>.</span><span class='id identifier rubyid_issuer_certificate'>issuer_certificate</span> <span class='op'>=</span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_ca_cert'>ca_cert</span><span class='period'>.</span><span class='id identifier rubyid_cert'>cert</span>
1046
+ <span class='id identifier rubyid_ef'>ef</span><span class='period'>.</span><span class='id identifier rubyid_crl'>crl</span> <span class='op'>=</span> <span class='id identifier rubyid_crl'>crl</span>
1047
+ <span class='comment'>#grab crl number from file, increment, write back
1048
+ </span> <span class='id identifier rubyid_crl_number'>crl_number</span> <span class='op'>=</span> <span class='id identifier rubyid_increment_crl_number'>increment_crl_number</span>
1049
+ <span class='id identifier rubyid_crlnum'>crlnum</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>ASN1</span><span class='op'>::</span><span class='const'>Integer</span><span class='lparen'>(</span><span class='id identifier rubyid_crl_number'>crl_number</span><span class='rparen'>)</span>
1050
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_add_extension'>add_extension</span><span class='lparen'>(</span><span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>X509</span><span class='op'>::</span><span class='const'>Extension</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>crlNumber</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_crlnum'>crlnum</span><span class='rparen'>)</span><span class='rparen'>)</span>
1051
+ <span class='id identifier rubyid_extensions'>extensions</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1052
+ <span class='id identifier rubyid_extensions'>extensions</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>authorityKeyIdentifier</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>keyid:always,issuer:always</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='kw'>false</span><span class='rbracket'>]</span>
1053
+ <span class='id identifier rubyid_extensions'>extensions</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_oid'>oid</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_critical'>critical</span><span class='op'>|</span>
1054
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_add_extension'>add_extension</span><span class='lparen'>(</span><span class='id identifier rubyid_ef'>ef</span><span class='period'>.</span><span class='id identifier rubyid_create_extension'>create_extension</span><span class='lparen'>(</span><span class='id identifier rubyid_oid'>oid</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_critical'>critical</span><span class='rparen'>)</span><span class='rparen'>)</span>
1055
+ <span class='rbrace'>}</span>
1056
+ <span class='id identifier rubyid_crl'>crl</span><span class='period'>.</span><span class='id identifier rubyid_sign'>sign</span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_ca_cert'>ca_cert</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Digest</span><span class='op'>::</span><span class='const'>SHA1</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
1057
+ <span class='ivar'>@crl</span> <span class='op'>=</span> <span class='id identifier rubyid_crl'>crl</span>
1058
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span>
1059
+ <span class='kw'>end</span></pre>
1060
+ </td>
1061
+ </tr>
1062
+ </table>
1063
+ </div>
1064
+
1065
+ <div class="method_details ">
1066
+ <h3 class="signature " id="last_update-instance_method">
1067
+
1068
+ - (<tt>Time</tt>) <strong>last_update</strong>
1069
+
1070
+
1071
+
1072
+
1073
+
1074
+ </h3><div class="docstring">
1075
+ <div class="discussion">
1076
+
1077
+ <p>Returns the signing time of the CRL</p>
1078
+
1079
+
1080
+ </div>
1081
+ </div>
1082
+ <div class="tags">
1083
+
1084
+ <p class="tag_title">Returns:</p>
1085
+ <ul class="return">
1086
+
1087
+ <li>
1088
+
1089
+
1090
+ <span class='type'>(<tt>Time</tt>)</span>
1091
+
1092
+
1093
+
1094
+ &mdash;
1095
+ <div class='inline'>
1096
+ <p>when the CRL was signed</p>
1097
+ </div>
1098
+
1099
+ </li>
1100
+
1101
+ </ul>
1102
+
1103
+ </div><table class="source_code">
1104
+ <tr>
1105
+ <td>
1106
+ <pre class="lines">
1107
+
1108
+
1109
+ 196
1110
+ 197
1111
+ 198</pre>
1112
+ </td>
1113
+ <td>
1114
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 196</span>
1115
+
1116
+ <span class='kw'>def</span> <span class='id identifier rubyid_last_update'>last_update</span>
1117
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_last_update'>last_update</span>
1118
+ <span class='kw'>end</span></pre>
1119
+ </td>
1120
+ </tr>
1121
+ </table>
1122
+ </div>
1123
+
1124
+ <div class="method_details ">
1125
+ <h3 class="signature " id="next_update-instance_method">
1126
+
1127
+ - (<tt>Time</tt>) <strong>next_update</strong>
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+ </h3><div class="docstring">
1134
+ <div class="discussion">
1135
+
1136
+ <p>Returns the next update time for the CRL</p>
1137
+
1138
+
1139
+ </div>
1140
+ </div>
1141
+ <div class="tags">
1142
+
1143
+ <p class="tag_title">Returns:</p>
1144
+ <ul class="return">
1145
+
1146
+ <li>
1147
+
1148
+
1149
+ <span class='type'>(<tt>Time</tt>)</span>
1150
+
1151
+
1152
+
1153
+ &mdash;
1154
+ <div class='inline'>
1155
+ <p>when it will be updated next</p>
1156
+ </div>
1157
+
1158
+ </li>
1159
+
1160
+ </ul>
1161
+
1162
+ </div><table class="source_code">
1163
+ <tr>
1164
+ <td>
1165
+ <pre class="lines">
1166
+
1167
+
1168
+ 203
1169
+ 204
1170
+ 205</pre>
1171
+ </td>
1172
+ <td>
1173
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 203</span>
1174
+
1175
+ <span class='kw'>def</span> <span class='id identifier rubyid_next_update'>next_update</span>
1176
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_next_update'>next_update</span>
1177
+ <span class='kw'>end</span></pre>
1178
+ </td>
1179
+ </tr>
1180
+ </table>
1181
+ </div>
1182
+
1183
+ <div class="method_details ">
1184
+ <h3 class="signature " id="revoke_cert-instance_method">
1185
+
1186
+ - (<tt>Object</tt>) <strong>revoke_cert</strong>(serial, reason = nil, revoke_time = Time.now.to_i, generate_and_save = true)
1187
+
1188
+
1189
+
1190
+
1191
+
1192
+ </h3><div class="docstring">
1193
+ <div class="discussion">
1194
+
1195
+ <p>Adds a certificate to the revocation list. After calling you must call
1196
+ generate_crl to sign a new CRL</p>
1197
+
1198
+
1199
+ </div>
1200
+ </div>
1201
+ <div class="tags">
1202
+ <p class="tag_title">Parameters:</p>
1203
+ <ul class="param">
1204
+
1205
+ <li>
1206
+
1207
+ <span class='name'>serial</span>
1208
+
1209
+
1210
+ <span class='type'>(<tt>Integer</tt>)</span>
1211
+
1212
+
1213
+
1214
+ &mdash;
1215
+ <div class='inline'>
1216
+ <p>serial number of the certificate to revoke</p>
1217
+ </div>
1218
+
1219
+ </li>
1220
+
1221
+ <li>
1222
+
1223
+ <span class='name'>reason</span>
1224
+
1225
+
1226
+ <span class='type'>(<tt>Integer</tt>)</span>
1227
+
1228
+
1229
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
1230
+
1231
+
1232
+ &mdash;
1233
+ <div class='inline'>
1234
+ <p>reason for revocation</p>
1235
+ </div>
1236
+
1237
+ </li>
1238
+
1239
+ <li>
1240
+
1241
+ <span class='name'>revoke_time</span>
1242
+
1243
+
1244
+ <span class='type'>(<tt>Integer</tt>)</span>
1245
+
1246
+
1247
+ <em class="default">(defaults to: <tt>Time.now.to_i</tt>)</em>
1248
+
1249
+
1250
+ </li>
1251
+
1252
+ <li>
1253
+
1254
+ <span class='name'>generate_and_save</span>
1255
+
1256
+
1257
+ <span class='type'>(<tt>Boolean</tt>)</span>
1258
+
1259
+
1260
+ <em class="default">(defaults to: <tt>true</tt>)</em>
1261
+
1262
+
1263
+ &mdash;
1264
+ <div class='inline'>
1265
+ <p>whether we want to generate the CRL and save its file (default=true)</p>
1266
+
1267
+ <p>reason codes defined by rfc 5280</p>
1268
+
1269
+ <p>CRLReason ::= ENUMERATED {</p>
1270
+
1271
+ <pre class="code ruby"><code>unspecified (0),
1272
+ keyCompromise (1),
1273
+ cACompromise (2),
1274
+ affiliationChanged (3),
1275
+ superseded (4),
1276
+ cessationOfOperation (5),
1277
+ certificateHold (6),
1278
+ removeFromCRL (8),
1279
+ privilegeWithdrawn (9),
1280
+ aACompromise (10) }</code></pre>
1281
+ </div>
1282
+
1283
+ </li>
1284
+
1285
+ </ul>
1286
+
1287
+
1288
+ </div><table class="source_code">
1289
+ <tr>
1290
+ <td>
1291
+ <pre class="lines">
1292
+
1293
+
1294
+ 227
1295
+ 228
1296
+ 229
1297
+ 230
1298
+ 231
1299
+ 232
1300
+ 233
1301
+ 234
1302
+ 235
1303
+ 236
1304
+ 237
1305
+ 238
1306
+ 239
1307
+ 240
1308
+ 241
1309
+ 242
1310
+ 243</pre>
1311
+ </td>
1312
+ <td>
1313
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 227</span>
1314
+
1315
+ <span class='kw'>def</span> <span class='id identifier rubyid_revoke_cert'>revoke_cert</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='comma'>,</span><span class='id identifier rubyid_reason'>reason</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='op'>=</span><span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='comma'>,</span> <span class='id identifier rubyid_generate_and_save'>generate_and_save</span><span class='op'>=</span><span class='kw'>true</span><span class='rparen'>)</span>
1316
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_reason'>reason</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='period'>.</span><span class='id identifier rubyid_between?'>between?</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>10</span><span class='rparen'>)</span>
1317
+ <span class='id identifier rubyid_reason'>reason</span> <span class='op'>=</span> <span class='int'>0</span>
1318
+ <span class='kw'>end</span>
1319
+ <span class='id identifier rubyid_serial'>serial</span> <span class='op'>=</span> <span class='id identifier rubyid_serial'>serial</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1320
+ <span class='id identifier rubyid_reason'>reason</span> <span class='op'>=</span> <span class='id identifier rubyid_reason'>reason</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1321
+ <span class='id identifier rubyid_revoke_time'>revoke_time</span> <span class='op'>=</span> <span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
1322
+ <span class='kw'>if</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>
1323
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Cannot revoke a previously revoked certificate</span><span class='tstring_end'>&quot;</span></span>
1324
+ <span class='kw'>end</span>
1325
+ <span class='ivar'>@revoked_certs</span><span class='lbracket'>[</span><span class='id identifier rubyid_serial'>serial</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='symbol'>:reason</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span> <span class='symbol'>:revoke_time</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='rbrace'>}</span>
1326
+ <span class='kw'>if</span> <span class='id identifier rubyid_generate_and_save'>generate_and_save</span>
1327
+ <span class='id identifier rubyid_generate_crl'>generate_crl</span><span class='lparen'>(</span><span class='rparen'>)</span>
1328
+ <span class='id identifier rubyid_save_crl_list'>save_crl_list</span><span class='lparen'>(</span><span class='rparen'>)</span>
1329
+ <span class='kw'>end</span>
1330
+ <span class='kw'>nil</span>
1331
+ <span class='kw'>end</span></pre>
1332
+ </td>
1333
+ </tr>
1334
+ </table>
1335
+ </div>
1336
+
1337
+ <div class="method_details ">
1338
+ <h3 class="signature " id="revoked?-instance_method">
1339
+
1340
+ - (<tt>Boolean</tt>) <strong>revoked?</strong>(serial)
1341
+
1342
+
1343
+
1344
+
1345
+
1346
+ </h3><div class="docstring">
1347
+ <div class="discussion">
1348
+
1349
+ <p>Indicates whether the serial number has been revoked, or not.</p>
1350
+
1351
+
1352
+ </div>
1353
+ </div>
1354
+ <div class="tags">
1355
+ <p class="tag_title">Parameters:</p>
1356
+ <ul class="param">
1357
+
1358
+ <li>
1359
+
1360
+ <span class='name'>serial</span>
1361
+
1362
+
1363
+ <span class='type'>(<tt>Integer</tt>)</span>
1364
+
1365
+
1366
+
1367
+ &mdash;
1368
+ <div class='inline'>
1369
+ <p>The serial number we want to check</p>
1370
+ </div>
1371
+
1372
+ </li>
1373
+
1374
+ </ul>
1375
+
1376
+ <p class="tag_title">Returns:</p>
1377
+ <ul class="return">
1378
+
1379
+ <li>
1380
+
1381
+
1382
+ <span class='type'>(<tt>Boolean</tt>)</span>
1383
+
1384
+
1385
+
1386
+ &mdash;
1387
+ <div class='inline'>
1388
+ <p>True if the serial number was revoked. False, otherwise.</p>
1389
+ </div>
1390
+
1391
+ </li>
1392
+
1393
+ </ul>
1394
+
1395
+ </div><table class="source_code">
1396
+ <tr>
1397
+ <td>
1398
+ <pre class="lines">
1399
+
1400
+
1401
+ 146
1402
+ 147
1403
+ 148</pre>
1404
+ </td>
1405
+ <td>
1406
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 146</span>
1407
+
1408
+ <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>
1409
+ <span class='ivar'>@revoked_certs</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
1410
+ <span class='kw'>end</span></pre>
1411
+ </td>
1412
+ </tr>
1413
+ </table>
1414
+ </div>
1415
+
1416
+ <div class="method_details ">
1417
+ <h3 class="signature " id="revoked_cert-instance_method">
1418
+
1419
+ - (<tt>Array</tt>) <strong>revoked_cert</strong>(serial)
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+ </h3><div class="docstring">
1426
+ <div class="discussion">
1427
+
1428
+ <p>Serial, reason, revoke_time tuple</p>
1429
+
1430
+
1431
+ </div>
1432
+ </div>
1433
+ <div class="tags">
1434
+
1435
+ <p class="tag_title">Returns:</p>
1436
+ <ul class="return">
1437
+
1438
+ <li>
1439
+
1440
+
1441
+ <span class='type'>(<tt>Array</tt>)</span>
1442
+
1443
+
1444
+
1445
+ &mdash;
1446
+ <div class='inline'>
1447
+ <p>serial, reason, revoke_time tuple</p>
1448
+ </div>
1449
+
1450
+ </li>
1451
+
1452
+ </ul>
1453
+
1454
+ </div><table class="source_code">
1455
+ <tr>
1456
+ <td>
1457
+ <pre class="lines">
1458
+
1459
+
1460
+ 151
1461
+ 152
1462
+ 153</pre>
1463
+ </td>
1464
+ <td>
1465
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 151</span>
1466
+
1467
+ <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>
1468
+ <span class='ivar'>@revoked_certs</span><span class='lbracket'>[</span><span class='id identifier rubyid_serial'>serial</span><span class='rbracket'>]</span>
1469
+ <span class='kw'>end</span></pre>
1470
+ </td>
1471
+ </tr>
1472
+ </table>
1473
+ </div>
1474
+
1475
+ <div class="method_details ">
1476
+ <h3 class="signature " id="revoked_certs-instance_method">
1477
+
1478
+ - (<tt>Array&lt;Array&gt;</tt>) <strong>revoked_certs</strong>
1479
+
1480
+
1481
+
1482
+
1483
+
1484
+ </h3><div class="docstring">
1485
+ <div class="discussion">
1486
+
1487
+ <p>Returns an array of serial, reason, revoke_time tuples.</p>
1488
+
1489
+
1490
+ </div>
1491
+ </div>
1492
+ <div class="tags">
1493
+
1494
+ <p class="tag_title">Returns:</p>
1495
+ <ul class="return">
1496
+
1497
+ <li>
1498
+
1499
+
1500
+ <span class='type'>(<tt>Array&lt;Array&gt;</tt>)</span>
1501
+
1502
+
1503
+
1504
+ &mdash;
1505
+ <div class='inline'>
1506
+ <p>Returns an array of serial, reason, revoke_time tuples.</p>
1507
+ </div>
1508
+
1509
+ </li>
1510
+
1511
+ </ul>
1512
+
1513
+ </div><table class="source_code">
1514
+ <tr>
1515
+ <td>
1516
+ <pre class="lines">
1517
+
1518
+
1519
+ 298
1520
+ 299
1521
+ 300
1522
+ 301
1523
+ 302
1524
+ 303
1525
+ 304</pre>
1526
+ </td>
1527
+ <td>
1528
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 298</span>
1529
+
1530
+ <span class='kw'>def</span> <span class='id identifier rubyid_revoked_certs'>revoked_certs</span>
1531
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1532
+ <span class='ivar'>@revoked_certs</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</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_serial'>serial</span><span class='op'>|</span>
1533
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_serial'>serial</span><span class='comma'>,</span> <span class='ivar'>@revoked_certs</span><span class='lbracket'>[</span><span class='id identifier rubyid_serial'>serial</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:reason</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@revoked_certs</span><span class='lbracket'>[</span><span class='id identifier rubyid_serial'>serial</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='symbol'>:revoke_time</span><span class='rbracket'>]</span><span class='rbracket'>]</span>
1534
+ <span class='kw'>end</span>
1535
+ <span class='id identifier rubyid_ret'>ret</span>
1536
+ <span class='kw'>end</span></pre>
1537
+ </td>
1538
+ </tr>
1539
+ </table>
1540
+ </div>
1541
+
1542
+ <div class="method_details ">
1543
+ <h3 class="signature " id="save_crl_list-instance_method">
1544
+
1545
+ - (<tt>Object</tt>) <strong>save_crl_list</strong>(filename_or_io = @crl_list_file)
1546
+
1547
+
1548
+
1549
+
1550
+
1551
+ </h3><div class="docstring">
1552
+ <div class="discussion">
1553
+
1554
+ <p>Saves the CRL list to a filename or IO. If the class was initialized with
1555
+ :crl_list_file, then the filename specified by that will be used by
1556
+ default.</p>
1557
+
1558
+
1559
+ </div>
1560
+ </div>
1561
+ <div class="tags">
1562
+ <p class="tag_title">Parameters:</p>
1563
+ <ul class="param">
1564
+
1565
+ <li>
1566
+
1567
+ <span class='name'>filename_or_io</span>
1568
+
1569
+
1570
+ <span class='type'>(<tt>String</tt>, <tt>#write</tt>, <tt>nil</tt>)</span>
1571
+
1572
+
1573
+ <em class="default">(defaults to: <tt>@crl_list_file</tt>)</em>
1574
+
1575
+
1576
+ &mdash;
1577
+ <div class='inline'>
1578
+ <p>If provided, the generated crl will be written to either the file (if a
1579
+ string), or IO. If nil, then the @crl_list_file will be used. If that is
1580
+ nil, then an error will be raised.</p>
1581
+ </div>
1582
+
1583
+ </li>
1584
+
1585
+ </ul>
1586
+
1587
+
1588
+ </div><table class="source_code">
1589
+ <tr>
1590
+ <td>
1591
+ <pre class="lines">
1592
+
1593
+
1594
+ 313
1595
+ 314
1596
+ 315
1597
+ 316
1598
+ 317
1599
+ 318
1600
+ 319
1601
+ 320
1602
+ 321
1603
+ 322</pre>
1604
+ </td>
1605
+ <td>
1606
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 313</span>
1607
+
1608
+ <span class='kw'>def</span> <span class='id identifier rubyid_save_crl_list'>save_crl_list</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span> <span class='op'>=</span> <span class='ivar'>@crl_list_file</span><span class='rparen'>)</span>
1609
+ <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1610
+
1611
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1612
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_revoked_certs'>revoked_certs</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_serial'>serial</span><span class='comma'>,</span> <span class='id identifier rubyid_reason'>reason</span><span class='comma'>,</span> <span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='op'>|</span>
1613
+ <span class='id identifier rubyid_data'>data</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_serial'>serial</span><span class='comma'>,</span> <span class='id identifier rubyid_revoke_time'>revoke_time</span><span class='comma'>,</span> <span class='id identifier rubyid_reason'>reason</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>,</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
1614
+ <span class='kw'>end</span>
1615
+ <span class='id identifier rubyid_write_data'>write_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='comma'>,</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
1616
+ <span class='kw'>nil</span>
1617
+ <span class='kw'>end</span></pre>
1618
+ </td>
1619
+ </tr>
1620
+ </table>
1621
+ </div>
1622
+
1623
+ <div class="method_details ">
1624
+ <h3 class="signature " id="save_crl_number-instance_method">
1625
+
1626
+ - (<tt>Object</tt>) <strong>save_crl_number</strong>(filename_or_io = @crl_number_file)
1627
+
1628
+
1629
+
1630
+
1631
+
1632
+ </h3><div class="docstring">
1633
+ <div class="discussion">
1634
+
1635
+ <p>Save the CRL number to a filename or IO. If the class was initialized with
1636
+ :crl_number_file, then the filename specified by that will be used by
1637
+ default.</p>
1638
+
1639
+
1640
+ </div>
1641
+ </div>
1642
+ <div class="tags">
1643
+ <p class="tag_title">Parameters:</p>
1644
+ <ul class="param">
1645
+
1646
+ <li>
1647
+
1648
+ <span class='name'>filename_or_io</span>
1649
+
1650
+
1651
+ <span class='type'>(<tt>String</tt>, <tt>#write</tt>, <tt>nil</tt>)</span>
1652
+
1653
+
1654
+ <em class="default">(defaults to: <tt>@crl_number_file</tt>)</em>
1655
+
1656
+
1657
+ &mdash;
1658
+ <div class='inline'>
1659
+ <p>If provided, the current crl number will be written to either the file (if
1660
+ a string), or IO. If nil, then the @crl_number_file will be used. If that
1661
+ is nil, then an error will be raised.</p>
1662
+ </div>
1663
+
1664
+ </li>
1665
+
1666
+ </ul>
1667
+
1668
+
1669
+ </div><table class="source_code">
1670
+ <tr>
1671
+ <td>
1672
+ <pre class="lines">
1673
+
1674
+
1675
+ 331
1676
+ 332
1677
+ 333
1678
+ 334
1679
+ 335
1680
+ 336
1681
+ 337</pre>
1682
+ </td>
1683
+ <td>
1684
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 331</span>
1685
+
1686
+ <span class='kw'>def</span> <span class='id identifier rubyid_save_crl_number'>save_crl_number</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span> <span class='op'>=</span> <span class='ivar'>@crl_number_file</span><span class='rparen'>)</span>
1687
+ <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1688
+ <span class='comment'># No valid filename or IO was specified, so bail.
1689
+ </span>
1690
+ <span class='id identifier rubyid_write_data'>write_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_crl_number'>crl_number</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span>
1691
+ <span class='kw'>nil</span>
1692
+ <span class='kw'>end</span></pre>
1693
+ </td>
1694
+ </tr>
1695
+ </table>
1696
+ </div>
1697
+
1698
+ <div class="method_details ">
1699
+ <h3 class="signature " id="to_crl-instance_method">
1700
+
1701
+ - (<tt><span class='object_link'><a href="Parser.html" title="R509::Crl::Parser (class)">R509::Crl::Parser</a></span></tt>) <strong>to_crl</strong>
1702
+
1703
+
1704
+
1705
+
1706
+
1707
+ </h3><div class="docstring">
1708
+ <div class="discussion">
1709
+
1710
+
1711
+ </div>
1712
+ </div>
1713
+ <div class="tags">
1714
+
1715
+ <p class="tag_title">Returns:</p>
1716
+ <ul class="return">
1717
+
1718
+ <li>
1719
+
1720
+
1721
+ <span class='type'>(<tt><span class='object_link'><a href="Parser.html" title="R509::Crl::Parser (class)">R509::Crl::Parser</a></span></tt>)</span>
1722
+
1723
+
1724
+
1725
+ </li>
1726
+
1727
+ </ul>
1728
+
1729
+ </div><table class="source_code">
1730
+ <tr>
1731
+ <td>
1732
+ <pre class="lines">
1733
+
1734
+
1735
+ 172
1736
+ 173
1737
+ 174
1738
+ 175</pre>
1739
+ </td>
1740
+ <td>
1741
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 172</span>
1742
+
1743
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_crl'>to_crl</span>
1744
+ <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>if</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
1745
+ <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='ivar'>@crl</span><span class='rparen'>)</span>
1746
+ <span class='kw'>end</span></pre>
1747
+ </td>
1748
+ </tr>
1749
+ </table>
1750
+ </div>
1751
+
1752
+ <div class="method_details ">
1753
+ <h3 class="signature " id="to_der-instance_method">
1754
+
1755
+ - (<tt>String</tt>) <strong>to_der</strong>
1756
+
1757
+
1758
+
1759
+
1760
+
1761
+ </h3><div class="docstring">
1762
+ <div class="discussion">
1763
+
1764
+ <p>Returns the CRL in DER format</p>
1765
+
1766
+
1767
+ </div>
1768
+ </div>
1769
+ <div class="tags">
1770
+
1771
+ <p class="tag_title">Returns:</p>
1772
+ <ul class="return">
1773
+
1774
+ <li>
1775
+
1776
+
1777
+ <span class='type'>(<tt>String</tt>)</span>
1778
+
1779
+
1780
+
1781
+ &mdash;
1782
+ <div class='inline'>
1783
+ <p>the CRL in DER format</p>
1784
+ </div>
1785
+
1786
+ </li>
1787
+
1788
+ </ul>
1789
+
1790
+ </div><table class="source_code">
1791
+ <tr>
1792
+ <td>
1793
+ <pre class="lines">
1794
+
1795
+
1796
+ 167
1797
+ 168
1798
+ 169</pre>
1799
+ </td>
1800
+ <td>
1801
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 167</span>
1802
+
1803
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_der'>to_der</span>
1804
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span>
1805
+ <span class='kw'>end</span></pre>
1806
+ </td>
1807
+ </tr>
1808
+ </table>
1809
+ </div>
1810
+
1811
+ <div class="method_details ">
1812
+ <h3 class="signature " id="to_pem-instance_method">
1813
+
1814
+ - (<tt>String</tt>) <strong>to_pem</strong>
1815
+
1816
+
1817
+
1818
+ <span class="aliases">Also known as:
1819
+ <span class="names"><span id='to_s-instance_method'>to_s</span></span>
1820
+ </span>
1821
+
1822
+
1823
+
1824
+ </h3><div class="docstring">
1825
+ <div class="discussion">
1826
+
1827
+ <p>Returns the CRL in PEM format</p>
1828
+
1829
+
1830
+ </div>
1831
+ </div>
1832
+ <div class="tags">
1833
+
1834
+ <p class="tag_title">Returns:</p>
1835
+ <ul class="return">
1836
+
1837
+ <li>
1838
+
1839
+
1840
+ <span class='type'>(<tt>String</tt>)</span>
1841
+
1842
+
1843
+
1844
+ &mdash;
1845
+ <div class='inline'>
1846
+ <p>the CRL in PEM format</p>
1847
+ </div>
1848
+
1849
+ </li>
1850
+
1851
+ </ul>
1852
+
1853
+ </div><table class="source_code">
1854
+ <tr>
1855
+ <td>
1856
+ <pre class="lines">
1857
+
1858
+
1859
+ 158
1860
+ 159
1861
+ 160</pre>
1862
+ </td>
1863
+ <td>
1864
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 158</span>
1865
+
1866
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_pem'>to_pem</span>
1867
+ <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span>
1868
+ <span class='kw'>end</span></pre>
1869
+ </td>
1870
+ </tr>
1871
+ </table>
1872
+ </div>
1873
+
1874
+ <div class="method_details ">
1875
+ <h3 class="signature " id="unrevoke_cert-instance_method">
1876
+
1877
+ - (<tt>Object</tt>) <strong>unrevoke_cert</strong>(serial)
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+ </h3><div class="docstring">
1884
+ <div class="discussion">
1885
+
1886
+ <p>Remove serial from revocation list. After unrevoking you must call
1887
+ generate_crl to sign a new CRL</p>
1888
+
1889
+
1890
+ </div>
1891
+ </div>
1892
+ <div class="tags">
1893
+ <p class="tag_title">Parameters:</p>
1894
+ <ul class="param">
1895
+
1896
+ <li>
1897
+
1898
+ <span class='name'>serial</span>
1899
+
1900
+
1901
+ <span class='type'>(<tt>Integer</tt>)</span>
1902
+
1903
+
1904
+
1905
+ &mdash;
1906
+ <div class='inline'>
1907
+ <p>serial number of the certificate to remove from revocation</p>
1908
+ </div>
1909
+
1910
+ </li>
1911
+
1912
+ </ul>
1913
+
1914
+
1915
+ </div><table class="source_code">
1916
+ <tr>
1917
+ <td>
1918
+ <pre class="lines">
1919
+
1920
+
1921
+ 248
1922
+ 249
1923
+ 250
1924
+ 251
1925
+ 252
1926
+ 253</pre>
1927
+ </td>
1928
+ <td>
1929
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 248</span>
1930
+
1931
+ <span class='kw'>def</span> <span class='id identifier rubyid_unrevoke_cert'>unrevoke_cert</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
1932
+ <span class='ivar'>@revoked_certs</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
1933
+ <span class='id identifier rubyid_generate_crl'>generate_crl</span><span class='lparen'>(</span><span class='rparen'>)</span>
1934
+ <span class='id identifier rubyid_save_crl_list'>save_crl_list</span><span class='lparen'>(</span><span class='rparen'>)</span>
1935
+ <span class='kw'>nil</span>
1936
+ <span class='kw'>end</span></pre>
1937
+ </td>
1938
+ </tr>
1939
+ </table>
1940
+ </div>
1941
+
1942
+ <div class="method_details ">
1943
+ <h3 class="signature " id="write_der-instance_method">
1944
+
1945
+ - (<tt>Object</tt>) <strong>write_der</strong>(filename_or_io)
1946
+
1947
+
1948
+
1949
+
1950
+
1951
+ </h3><div class="docstring">
1952
+ <div class="discussion">
1953
+
1954
+ <p>Writes the CRL into the PEM format</p>
1955
+
1956
+
1957
+ </div>
1958
+ </div>
1959
+ <div class="tags">
1960
+ <p class="tag_title">Parameters:</p>
1961
+ <ul class="param">
1962
+
1963
+ <li>
1964
+
1965
+ <span class='name'>filename_or_io</span>
1966
+
1967
+
1968
+ <span class='type'>(<tt>String</tt>, <tt>#write</tt>)</span>
1969
+
1970
+
1971
+
1972
+ &mdash;
1973
+ <div class='inline'>
1974
+ <p>Either a string of the path for the file that you'd like to write, or an
1975
+ IO-like object.</p>
1976
+ </div>
1977
+
1978
+ </li>
1979
+
1980
+ </ul>
1981
+
1982
+
1983
+ </div><table class="source_code">
1984
+ <tr>
1985
+ <td>
1986
+ <pre class="lines">
1987
+
1988
+
1989
+ 189
1990
+ 190
1991
+ 191</pre>
1992
+ </td>
1993
+ <td>
1994
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 189</span>
1995
+
1996
+ <span class='kw'>def</span> <span class='id identifier rubyid_write_der'>write_der</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='rparen'>)</span>
1997
+ <span class='id identifier rubyid_write_data'>write_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='comma'>,</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span><span class='rparen'>)</span>
1998
+ <span class='kw'>end</span></pre>
1999
+ </td>
2000
+ </tr>
2001
+ </table>
2002
+ </div>
2003
+
2004
+ <div class="method_details ">
2005
+ <h3 class="signature " id="write_pem-instance_method">
2006
+
2007
+ - (<tt>Object</tt>) <strong>write_pem</strong>(filename_or_io)
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+ </h3><div class="docstring">
2014
+ <div class="discussion">
2015
+
2016
+ <p>Writes the CRL into the PEM format</p>
2017
+
2018
+
2019
+ </div>
2020
+ </div>
2021
+ <div class="tags">
2022
+ <p class="tag_title">Parameters:</p>
2023
+ <ul class="param">
2024
+
2025
+ <li>
2026
+
2027
+ <span class='name'>filename_or_io</span>
2028
+
2029
+
2030
+ <span class='type'>(<tt>String</tt>, <tt>#write</tt>)</span>
2031
+
2032
+
2033
+
2034
+ &mdash;
2035
+ <div class='inline'>
2036
+ <p>Either a string of the path for the file that you'd like to write, or an
2037
+ IO-like object.</p>
2038
+ </div>
2039
+
2040
+ </li>
2041
+
2042
+ </ul>
2043
+
2044
+
2045
+ </div><table class="source_code">
2046
+ <tr>
2047
+ <td>
2048
+ <pre class="lines">
2049
+
2050
+
2051
+ 181
2052
+ 182
2053
+ 183</pre>
2054
+ </td>
2055
+ <td>
2056
+ <pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 181</span>
2057
+
2058
+ <span class='kw'>def</span> <span class='id identifier rubyid_write_pem'>write_pem</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='rparen'>)</span>
2059
+ <span class='id identifier rubyid_write_data'>write_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='comma'>,</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span><span class='rparen'>)</span>
2060
+ <span class='kw'>end</span></pre>
2061
+ </td>
2062
+ </tr>
2063
+ </table>
2064
+ </div>
2065
+
2066
+ </div>
2067
+
2068
+ </div>
2069
+
2070
+ <div id="footer">
2071
+ Generated on Tue Oct 23 22:48:02 2012 by
2072
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2073
+ 0.8.0 (ruby-1.9.3).
2074
+ </div>
2075
+
2076
+ </body>
2077
+ </html>