r509 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +2 -0
  4. data/CONTRIBUTING.mdown +21 -0
  5. data/LICENSE +13 -0
  6. data/README.mdown +548 -0
  7. data/Rakefile +5 -0
  8. data/bin/r509 +16 -17
  9. data/doc/R509.html +42 -26
  10. data/doc/R509/ASN1.html +22 -16
  11. data/doc/R509/ASN1/GeneralName.html +180 -173
  12. data/doc/R509/ASN1/GeneralNames.html +390 -62
  13. data/doc/R509/CRL.html +9 -7
  14. data/doc/R509/CRL/Administrator.html +208 -623
  15. data/doc/R509/CRL/FileReaderWriter.html +856 -0
  16. data/doc/R509/CRL/ReaderWriter.html +524 -0
  17. data/doc/R509/CRL/SignedList.html +29 -42
  18. data/doc/R509/CSR.html +248 -333
  19. data/doc/R509/Cert.html +364 -491
  20. data/doc/R509/Cert/Extensions.html +134 -43
  21. data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +335 -65
  22. data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +201 -102
  23. data/doc/R509/Cert/Extensions/BasicConstraints.html +297 -68
  24. data/doc/R509/Cert/Extensions/CRLDistributionPoints.html +690 -77
  25. data/doc/R509/Cert/Extensions/CertificatePolicies.html +293 -43
  26. data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +321 -173
  27. data/doc/R509/Cert/Extensions/GeneralNamesMixin.html +656 -0
  28. data/doc/R509/Cert/Extensions/InhibitAnyPolicy.html +270 -42
  29. data/doc/R509/Cert/Extensions/KeyUsage.html +334 -184
  30. data/doc/R509/Cert/Extensions/NameConstraints.html +363 -93
  31. data/doc/R509/{ASN1 → Cert/Extensions}/NoticeReference.html +209 -48
  32. data/doc/R509/Cert/Extensions/OCSPNoCheck.html +244 -17
  33. data/doc/R509/Cert/Extensions/PolicyConstraints.html +322 -71
  34. data/doc/R509/{ASN1 → Cert/Extensions}/PolicyInformation.html +204 -43
  35. data/doc/R509/{ASN1 → Cert/Extensions}/PolicyQualifiers.html +205 -48
  36. data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +348 -143
  37. data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +165 -13
  38. data/doc/R509/{ASN1 → Cert/Extensions}/UserNotice.html +204 -43
  39. data/doc/R509/Cert/Extensions/ValidationMixin.html +120 -0
  40. data/doc/R509/CertificateAuthority.html +9 -7
  41. data/doc/R509/CertificateAuthority/OptionsBuilder.html +475 -0
  42. data/doc/R509/CertificateAuthority/Signer.html +149 -198
  43. data/doc/R509/Config.html +10 -8
  44. data/doc/R509/Config/CAConfig.html +708 -625
  45. data/doc/R509/Config/CAConfigPool.html +179 -31
  46. data/doc/R509/Config/CertProfile.html +1544 -0
  47. data/doc/R509/Config/SubjectItemPolicy.html +437 -99
  48. data/doc/R509/Engine.html +14 -28
  49. data/doc/R509/Helpers.html +1014 -0
  50. data/doc/R509/MessageDigest.html +73 -25
  51. data/doc/R509/NameSanitizer.html +39 -39
  52. data/doc/R509/OCSP.html +5 -5
  53. data/doc/R509/OCSP/Request.html +5 -5
  54. data/doc/R509/OCSP/Request/Nonce.html +5 -5
  55. data/doc/R509/OCSP/Response.html +7 -7
  56. data/doc/R509/OIDMapper.html +121 -6
  57. data/doc/R509/PrivateKey.html +226 -227
  58. data/doc/R509/R509Error.html +5 -5
  59. data/doc/R509/SPKI.html +244 -342
  60. data/doc/R509/Subject.html +241 -70
  61. data/doc/R509/Validity.html +5 -5
  62. data/doc/R509/Validity/Checker.html +5 -5
  63. data/doc/R509/Validity/DefaultChecker.html +5 -9
  64. data/doc/R509/Validity/DefaultWriter.html +5 -9
  65. data/doc/R509/Validity/Status.html +5 -5
  66. data/doc/R509/Validity/Writer.html +5 -5
  67. data/doc/_index.html +92 -30
  68. data/doc/class_list.html +2 -2
  69. data/doc/file.CONTRIBUTING.html +96 -0
  70. data/doc/file.LICENSE.html +87 -0
  71. data/doc/file.README.html +279 -389
  72. data/doc/file.YAML.html +243 -0
  73. data/doc/file.r509.html +298 -105
  74. data/doc/file_list.html +11 -2
  75. data/doc/frames.html +1 -1
  76. data/doc/index.html +279 -389
  77. data/doc/js/full_list.js +6 -1
  78. data/doc/method_list.html +869 -1139
  79. data/doc/top-level-namespace.html +103 -5
  80. data/lib/r509.rb +7 -2
  81. data/lib/r509/asn1.rb +97 -135
  82. data/lib/r509/cert.rb +17 -106
  83. data/lib/r509/cert/extensions.rb +13 -676
  84. data/lib/r509/cert/extensions/authority_info_access.rb +128 -0
  85. data/lib/r509/cert/extensions/authority_key_identifier.rb +100 -0
  86. data/lib/r509/cert/extensions/base.rb +142 -0
  87. data/lib/r509/cert/extensions/basic_constraints.rb +119 -0
  88. data/lib/r509/cert/extensions/certificate_policies.rb +262 -0
  89. data/lib/r509/cert/extensions/crl_distribution_points.rb +98 -0
  90. data/lib/r509/cert/extensions/extended_key_usage.rb +189 -0
  91. data/lib/r509/cert/extensions/inhibit_any_policy.rb +70 -0
  92. data/lib/r509/cert/extensions/key_usage.rb +209 -0
  93. data/lib/r509/cert/extensions/name_constraints.rb +179 -0
  94. data/lib/r509/cert/extensions/ocsp_no_check.rb +56 -0
  95. data/lib/r509/cert/extensions/policy_constraints.rb +122 -0
  96. data/lib/r509/cert/extensions/subject_alternative_name.rb +88 -0
  97. data/lib/r509/cert/extensions/subject_key_identifier.rb +56 -0
  98. data/lib/r509/cert/extensions/validation_mixin.rb +42 -0
  99. data/lib/r509/certificate_authority/options_builder.rb +142 -0
  100. data/lib/r509/certificate_authority/signer.rb +189 -0
  101. data/lib/r509/config.rb +3 -600
  102. data/lib/r509/config/ca_config.rb +414 -0
  103. data/lib/r509/config/cert_profile.rb +110 -0
  104. data/lib/r509/config/subject_item_policy.rb +118 -0
  105. data/lib/r509/crl/administrator.rb +169 -0
  106. data/lib/r509/crl/reader_writer.rb +109 -0
  107. data/lib/r509/crl/signed_list.rb +135 -0
  108. data/lib/r509/csr.rb +35 -116
  109. data/lib/r509/engine.rb +21 -11
  110. data/lib/r509/helpers.rb +110 -0
  111. data/lib/r509/io_helpers.rb +18 -13
  112. data/lib/r509/message_digest.rb +13 -3
  113. data/lib/r509/oid_mapper.rb +14 -0
  114. data/lib/r509/private_key.rb +74 -50
  115. data/lib/r509/spki.rb +50 -113
  116. data/lib/r509/subject.rb +24 -2
  117. data/lib/r509/trollop.rb +788 -0
  118. data/lib/r509/version.rb +1 -1
  119. data/r509.yaml +289 -96
  120. data/spec/asn1_spec.rb +171 -98
  121. data/spec/cert/extensions/authority_info_access_spec.rb +247 -0
  122. data/spec/cert/extensions/authority_key_identifier_spec.rb +85 -0
  123. data/spec/cert/extensions/base_spec.rb +172 -0
  124. data/spec/cert/extensions/basic_constraints_spec.rb +185 -0
  125. data/spec/cert/extensions/certificate_policies_spec.rb +288 -0
  126. data/spec/cert/extensions/crl_distribution_points_spec.rb +149 -0
  127. data/spec/cert/extensions/extended_key_usage_spec.rb +174 -0
  128. data/spec/cert/extensions/inhibit_any_policy_spec.rb +92 -0
  129. data/spec/cert/extensions/key_usage_spec.rb +172 -0
  130. data/spec/cert/extensions/name_constraints_spec.rb +335 -0
  131. data/spec/cert/extensions/ocsp_no_check_spec.rb +76 -0
  132. data/spec/cert/extensions/policy_constraints_spec.rb +155 -0
  133. data/spec/cert/extensions/subject_alternative_name_spec.rb +354 -0
  134. data/spec/cert/extensions/subject_key_identifier_spec.rb +64 -0
  135. data/spec/cert_spec.rb +11 -9
  136. data/spec/certificate_authority/options_builder_spec.rb +307 -0
  137. data/spec/certificate_authority/signer_spec.rb +278 -0
  138. data/spec/config/ca_config_spec.rb +405 -0
  139. data/spec/config/cert_profile_spec.rb +88 -0
  140. data/spec/config/subject_item_policy_spec.rb +81 -0
  141. data/spec/crl/administrator_spec.rb +199 -0
  142. data/spec/crl/reader_writer_spec.rb +97 -0
  143. data/spec/crl/signed_list_spec.rb +84 -0
  144. data/spec/csr_spec.rb +43 -36
  145. data/spec/engine_spec.rb +51 -0
  146. data/spec/fixtures.rb +40 -40
  147. data/spec/fixtures/cert1.pem +1 -1
  148. data/spec/fixtures/config_pool_test_minimal.yaml +11 -15
  149. data/spec/fixtures/config_test.yaml +96 -59
  150. data/spec/fixtures/config_test_dsa.yaml +29 -35
  151. data/spec/fixtures/config_test_ec.yaml +29 -35
  152. data/spec/fixtures/config_test_engine_key.yaml +7 -7
  153. data/spec/fixtures/config_test_engine_no_key_name.yaml +6 -6
  154. data/spec/fixtures/config_test_minimal.yaml +3 -5
  155. data/spec/fixtures/config_test_password.yaml +4 -6
  156. data/spec/fixtures/config_test_various.yaml +147 -137
  157. data/spec/fixtures/crl_list_file.txt +1 -1
  158. data/spec/fixtures/test_ca_crl.cer +20 -0
  159. data/spec/fixtures/test_ca_crl.key +28 -0
  160. data/spec/fixtures/test_ca_crl.p12 +0 -0
  161. data/spec/message_digest_spec.rb +6 -0
  162. data/spec/oid_mapper_spec.rb +11 -0
  163. data/spec/private_key_spec.rb +19 -18
  164. data/spec/spec_helper.rb +10 -6
  165. data/spec/spki_spec.rb +38 -19
  166. data/spec/subject_spec.rb +16 -0
  167. metadata +108 -59
  168. metadata.gz.sig +0 -0
  169. data/README.md +0 -638
  170. data/doc/R509/Config/CAProfile.html +0 -1015
  171. data/doc/R509/IOHelpers.html +0 -564
  172. data/lib/r509/certificate_authority.rb +0 -407
  173. data/lib/r509/crl.rb +0 -351
  174. data/spec/cert/extensions_spec.rb +0 -1095
  175. data/spec/certificate_authority_spec.rb +0 -681
  176. data/spec/config_spec.rb +0 -562
  177. data/spec/crl_spec.rb +0 -226
@@ -6,13 +6,13 @@
6
6
  <title>
7
7
  Class: R509::Cert::Extensions::InhibitAnyPolicy
8
8
 
9
- &mdash; Documentation by YARD 0.8.5
9
+ &mdash; Documentation by YARD 0.8.6.1
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
@@ -92,11 +92,15 @@
92
92
 
93
93
 
94
94
 
95
+ <dt class="r2">Includes:</dt>
96
+ <dd class="r2"><span class='object_link'><a href="ValidationMixin.html" title="R509::Cert::Extensions::ValidationMixin (module)">ValidationMixin</a></span></dd>
97
+
98
+
95
99
 
96
100
 
97
101
 
98
- <dt class="r2 last">Defined in:</dt>
99
- <dd class="r2 last">lib/r509/cert/extensions.rb</dd>
102
+ <dt class="r1 last">Defined in:</dt>
103
+ <dd class="r1 last">lib/r509/cert/extensions/inhibit_any_policy.rb</dd>
100
104
 
101
105
  </dl>
102
106
  <div class="clear"></div>
@@ -104,8 +108,17 @@
104
108
  <h2>Overview</h2><div class="docstring">
105
109
  <div class="discussion">
106
110
 
107
- <p>Implements the InhibitAnyPolicy certificate extension, with methods to
108
- provide access to the component and meaning of the extension's contents.</p>
111
+ <p>The inhibit anyPolicy extension indicates that the special anyPolicy OID,
112
+ with the value { 2 5 29 32 0 }, is not considered an explicit match for
113
+ other certificate policies except when it appears in an intermediate
114
+ self-issued CA certificate. The value indicates the number of additional
115
+ non-self-issued certificates that may appear in the path before anyPolicy
116
+ is no longer permitted. For example, a value of one indicates that
117
+ anyPolicy may be processed in certificates issued by the subject of this
118
+ certificate, but not in additional certificates in the path.</p>
119
+
120
+ <p>You can use this extension to parse an existing extension for easy access
121
+ to the contents or create a new one.</p>
109
122
 
110
123
 
111
124
  </div>
@@ -146,7 +159,7 @@ provide access to the component and meaning of the extension's contents.</p>
146
159
  <li class="public ">
147
160
  <span class="summary_signature">
148
161
 
149
- <a href="#skip_certs-instance_method" title="#skip_certs (instance method)">- (Object) <strong>skip_certs</strong> </a>
162
+ <a href="#value-instance_method" title="#value (instance method)">- (Integer) <strong>value</strong> </a>
150
163
 
151
164
 
152
165
 
@@ -165,9 +178,7 @@ provide access to the component and meaning of the extension's contents.</p>
165
178
 
166
179
 
167
180
 
168
- <span class="summary_desc"><div class='inline'>
169
- <p>Returns the value of attribute skip_certs.</p>
170
- </div></span>
181
+ <span class="summary_desc"><div class='inline'></div></span>
171
182
 
172
183
  </li>
173
184
 
@@ -188,7 +199,7 @@ provide access to the component and meaning of the extension's contents.</p>
188
199
  <li class="public ">
189
200
  <span class="summary_signature">
190
201
 
191
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (InhibitAnyPolicy) <strong>initialize</strong>(*args) </a>
202
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (InhibitAnyPolicy) <strong>initialize</strong>(arg) </a>
192
203
 
193
204
 
194
205
 
@@ -205,9 +216,53 @@ provide access to the component and meaning of the extension's contents.</p>
205
216
 
206
217
 
207
218
  <span class="summary_desc"><div class='inline'>
208
- <p>A new instance of InhibitAnyPolicy.</p>
219
+ <p>This method takes a hash or an existing Extension object to parse.</p>
209
220
  </div></span>
210
221
 
222
+ </li>
223
+
224
+
225
+ <li class="public ">
226
+ <span class="summary_signature">
227
+
228
+ <a href="#to_h-instance_method" title="#to_h (instance method)">- (Hash) <strong>to_h</strong> </a>
229
+
230
+
231
+
232
+ </span>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ <span class="summary_desc"><div class='inline'></div></span>
243
+
244
+ </li>
245
+
246
+
247
+ <li class="public ">
248
+ <span class="summary_signature">
249
+
250
+ <a href="#to_yaml-instance_method" title="#to_yaml (instance method)">- (YAML) <strong>to_yaml</strong> </a>
251
+
252
+
253
+
254
+ </span>
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+ <span class="summary_desc"><div class='inline'></div></span>
265
+
211
266
  </li>
212
267
 
213
268
 
@@ -215,13 +270,15 @@ provide access to the component and meaning of the extension's contents.</p>
215
270
 
216
271
 
217
272
 
273
+
274
+
218
275
  <div id="constructor_details" class="method_details_list">
219
276
  <h2>Constructor Details</h2>
220
277
 
221
278
  <div class="method_details first">
222
279
  <h3 class="signature first" id="initialize-instance_method">
223
280
 
224
- - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::InhibitAnyPolicy (class)">InhibitAnyPolicy</a></span></tt>) <strong>initialize</strong>(*args)
281
+ - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::InhibitAnyPolicy (class)">InhibitAnyPolicy</a></span></tt>) <strong>initialize</strong>(arg)
225
282
 
226
283
 
227
284
 
@@ -230,13 +287,63 @@ provide access to the component and meaning of the extension's contents.</p>
230
287
  </h3><div class="docstring">
231
288
  <div class="discussion">
232
289
 
233
- <p>A new instance of InhibitAnyPolicy</p>
290
+ <p>This method takes a hash or an existing Extension object to parse</p>
234
291
 
235
292
 
236
293
  </div>
237
294
  </div>
238
295
  <div class="tags">
296
+ <p class="tag_title">Parameters:</p>
297
+ <ul class="param">
298
+
299
+ <li>
300
+
301
+ <span class='name'>arg</span>
302
+
303
+
304
+ <span class='type'>(<tt>Hash</tt>)</span>
305
+
306
+
307
+
308
+ &mdash;
309
+ <div class='inline'>
310
+ <p>a customizable set of options</p>
311
+ </div>
312
+
313
+ </li>
314
+
315
+ </ul>
316
+
239
317
 
318
+
319
+
320
+ <p class="tag_title">Options Hash (<tt>arg</tt>):</p>
321
+ <ul class="option">
322
+
323
+ <li>
324
+ <span class="name">:value</span>
325
+ <span class="type">(<tt>Integer</tt>)</span>
326
+ <span class="default">
327
+
328
+ </span>
329
+
330
+ </li>
331
+
332
+ <li>
333
+ <span class="name">:critical</span>
334
+ <span class="type">(<tt>Boolean</tt>)</span>
335
+ <span class="default">
336
+
337
+ &mdash; default:
338
+ <tt>true</tt>
339
+
340
+ </span>
341
+
342
+ </li>
343
+
344
+ </ul>
345
+
346
+
240
347
 
241
348
  </div><table class="source_code">
242
349
  <tr>
@@ -244,26 +351,26 @@ provide access to the component and meaning of the extension's contents.</p>
244
351
  <pre class="lines">
245
352
 
246
353
 
247
- 539
248
- 540
249
- 541
250
- 542
251
- 543
252
- 544
253
- 545
254
- 546</pre>
354
+ 33
355
+ 34
356
+ 35
357
+ 36
358
+ 37
359
+ 38
360
+ 39
361
+ 40</pre>
255
362
  </td>
256
363
  <td>
257
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 539</span>
364
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 33</span>
258
365
 
259
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
260
- <span class='kw'>super</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
366
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
367
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Cert</span><span class='op'>::</span><span class='const'>Extensions</span><span class='period'>.</span><span class='id identifier rubyid_is_extension?'>is_extension?</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
368
+ <span class='id identifier rubyid_arg'>arg</span> <span class='op'>=</span> <span class='id identifier rubyid_build_extension'>build_extension</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
369
+ <span class='kw'>end</span>
261
370
 
262
- <span class='comment'># id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::= { id-ce 54 }
263
- </span> <span class='comment'># InhibitAnyPolicy ::= SkipCerts
264
- </span> <span class='comment'># SkipCerts ::= INTEGER (0..MAX)
265
- </span> <span class='ivar'>@skip_certs</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='period'>.</span><span class='id identifier rubyid_get_extension_payload'>get_extension_payload</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> <span class='comment'># returns a non-negative integer
266
- </span><span class='kw'>end</span></pre>
371
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
372
+ <span class='id identifier rubyid_parse_extension'>parse_extension</span>
373
+ <span class='kw'>end</span></pre>
267
374
  </td>
268
375
  </tr>
269
376
  </table>
@@ -277,9 +384,9 @@ provide access to the component and meaning of the extension's contents.</p>
277
384
 
278
385
  <span id=""></span>
279
386
  <div class="method_details first">
280
- <h3 class="signature first" id="skip_certs-instance_method">
387
+ <h3 class="signature first" id="value-instance_method">
281
388
 
282
- - (<tt>Object</tt>) <strong>skip_certs</strong> <span class="extras">(readonly)</span>
389
+ - (<tt>Integer</tt>) <strong>value</strong> <span class="extras">(readonly)</span>
283
390
 
284
391
 
285
392
 
@@ -288,13 +395,83 @@ provide access to the component and meaning of the extension's contents.</p>
288
395
  </h3><div class="docstring">
289
396
  <div class="discussion">
290
397
 
291
- <p>Returns the value of attribute skip_certs</p>
292
398
 
399
+ </div>
400
+ </div>
401
+ <div class="tags">
402
+
403
+ <p class="tag_title">Returns:</p>
404
+ <ul class="return">
405
+
406
+ <li>
407
+
408
+
409
+ <span class='type'>(<tt>Integer</tt>)</span>
410
+
411
+
412
+
413
+ </li>
414
+
415
+ </ul>
416
+
417
+ </div><table class="source_code">
418
+ <tr>
419
+ <td>
420
+ <pre class="lines">
421
+
422
+
423
+ 27
424
+ 28
425
+ 29</pre>
426
+ </td>
427
+ <td>
428
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 27</span>
429
+
430
+ <span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span>
431
+ <span class='ivar'>@value</span>
432
+ <span class='kw'>end</span></pre>
433
+ </td>
434
+ </tr>
435
+ </table>
436
+ </div>
437
+
438
+ </div>
439
+
440
+
441
+ <div id="instance_method_details" class="method_details_list">
442
+ <h2>Instance Method Details</h2>
443
+
444
+
445
+ <div class="method_details first">
446
+ <h3 class="signature first" id="to_h-instance_method">
447
+
448
+ - (<tt>Hash</tt>) <strong>to_h</strong>
449
+
450
+
451
+
452
+
453
+
454
+ </h3><div class="docstring">
455
+ <div class="discussion">
456
+
293
457
 
294
458
  </div>
295
459
  </div>
296
460
  <div class="tags">
297
461
 
462
+ <p class="tag_title">Returns:</p>
463
+ <ul class="return">
464
+
465
+ <li>
466
+
467
+
468
+ <span class='type'>(<tt>Hash</tt>)</span>
469
+
470
+
471
+
472
+ </li>
473
+
474
+ </ul>
298
475
 
299
476
  </div><table class="source_code">
300
477
  <tr>
@@ -302,30 +479,81 @@ provide access to the component and meaning of the extension's contents.</p>
302
479
  <pre class="lines">
303
480
 
304
481
 
305
- 537
306
- 538
307
- 539</pre>
482
+ 43
483
+ 44
484
+ 45</pre>
308
485
  </td>
309
486
  <td>
310
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 537</span>
487
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 43</span>
311
488
 
312
- <span class='kw'>def</span> <span class='id identifier rubyid_skip_certs'>skip_certs</span>
313
- <span class='ivar'>@skip_certs</span>
489
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
490
+ <span class='lbrace'>{</span> <span class='symbol'>:critical</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_critical?'>critical?</span><span class='comma'>,</span> <span class='symbol'>:value</span> <span class='op'>=&gt;</span> <span class='ivar'>@value</span> <span class='rbrace'>}</span>
314
491
  <span class='kw'>end</span></pre>
315
492
  </td>
316
493
  </tr>
317
494
  </table>
318
495
  </div>
319
496
 
497
+ <div class="method_details ">
498
+ <h3 class="signature " id="to_yaml-instance_method">
499
+
500
+ - (<tt>YAML</tt>) <strong>to_yaml</strong>
501
+
502
+
503
+
504
+
505
+
506
+ </h3><div class="docstring">
507
+ <div class="discussion">
508
+
509
+
320
510
  </div>
511
+ </div>
512
+ <div class="tags">
513
+
514
+ <p class="tag_title">Returns:</p>
515
+ <ul class="return">
516
+
517
+ <li>
518
+
519
+
520
+ <span class='type'>(<tt>YAML</tt>)</span>
521
+
522
+
523
+
524
+ </li>
525
+
526
+ </ul>
527
+
528
+ </div><table class="source_code">
529
+ <tr>
530
+ <td>
531
+ <pre class="lines">
321
532
 
322
533
 
534
+ 48
535
+ 49
536
+ 50</pre>
537
+ </td>
538
+ <td>
539
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/inhibit_any_policy.rb', line 48</span>
540
+
541
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_yaml'>to_yaml</span>
542
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='period'>.</span><span class='id identifier rubyid_to_yaml'>to_yaml</span>
543
+ <span class='kw'>end</span></pre>
544
+ </td>
545
+ </tr>
546
+ </table>
547
+ </div>
548
+
549
+ </div>
550
+
323
551
  </div>
324
552
 
325
553
  <div id="footer">
326
- Generated on Tue Apr 23 10:46:07 2013 by
554
+ Generated on Sun Jan 26 13:37:28 2014 by
327
555
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
328
- 0.8.5 (ruby-1.9.3).
556
+ 0.8.6.1 (ruby-2.0.0).
329
557
  </div>
330
558
 
331
559
  </body>
@@ -6,13 +6,13 @@
6
6
  <title>
7
7
  Class: R509::Cert::Extensions::KeyUsage
8
8
 
9
- &mdash; Documentation by YARD 0.8.5
9
+ &mdash; Documentation by YARD 0.8.6.1
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
@@ -92,11 +92,15 @@
92
92
 
93
93
 
94
94
 
95
+ <dt class="r2">Includes:</dt>
96
+ <dd class="r2"><span class='object_link'><a href="ValidationMixin.html" title="R509::Cert::Extensions::ValidationMixin (module)">ValidationMixin</a></span></dd>
97
+
98
+
95
99
 
96
100
 
97
101
 
98
- <dt class="r2 last">Defined in:</dt>
99
- <dd class="r2 last">lib/r509/cert/extensions.rb</dd>
102
+ <dt class="r1 last">Defined in:</dt>
103
+ <dd class="r1 last">lib/r509/cert/extensions/key_usage.rb</dd>
100
104
 
101
105
  </dl>
102
106
  <div class="clear"></div>
@@ -104,8 +108,20 @@
104
108
  <h2>Overview</h2><div class="docstring">
105
109
  <div class="discussion">
106
110
 
107
- <p>Implements the KeyUsage certificate extension, with methods to provide
108
- access to the components and meaning of the extension's contents.</p>
111
+ <p>RFC 5280 Description (see: <a
112
+ href="http://www.ietf.org/rfc/rfc5280.txt">www.ietf.org/rfc/rfc5280.txt</a>)</p>
113
+
114
+ <p>The key usage extension defines the purpose (e.g., encipherment, signature,
115
+ certificate signing) of the key contained in the certificate. The usage
116
+ restriction might be employed when a key that could be used for more than
117
+ one operation is to be restricted. For example, when an RSA key should be
118
+ used only to verify signatures on objects other than public key
119
+ certificates and CRLs, the digitalSignature and/or nonRepudiation bits
120
+ would be asserted. Likewise, when an RSA key should be used only for key
121
+ management, the keyEncipherment bit would be asserted.</p>
122
+
123
+ <p>You can use this extension to parse an existing extension for easy access
124
+ to the contents or create a new one.</p>
109
125
 
110
126
 
111
127
  </div>
@@ -290,7 +306,7 @@ access to the components and meaning of the extension's contents.</p>
290
306
  <li class="public ">
291
307
  <span class="summary_signature">
292
308
 
293
- <a href="#allowed_uses-instance_method" title="#allowed_uses (instance method)">- (Object) <strong>allowed_uses</strong> </a>
309
+ <a href="#allowed_uses-instance_method" title="#allowed_uses (instance method)">- (Array<sup>?</sup>) <strong>allowed_uses</strong> </a>
294
310
 
295
311
 
296
312
 
@@ -310,7 +326,7 @@ access to the components and meaning of the extension's contents.</p>
310
326
 
311
327
 
312
328
  <span class="summary_desc"><div class='inline'>
313
- <p>An array of the key uses allowed.</p>
329
+ <p>An array (of strings) of the key uses allowed.</p>
314
330
  </div></span>
315
331
 
316
332
  </li>
@@ -466,7 +482,7 @@ access to the components and meaning of the extension's contents.</p>
466
482
  <li class="public ">
467
483
  <span class="summary_signature">
468
484
 
469
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (KeyUsage) <strong>initialize</strong>(*args) </a>
485
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (KeyUsage) <strong>initialize</strong>(arg) </a>
470
486
 
471
487
 
472
488
 
@@ -483,7 +499,7 @@ access to the components and meaning of the extension's contents.</p>
483
499
 
484
500
 
485
501
  <span class="summary_desc"><div class='inline'>
486
- <p>See OpenSSL::X509::Extension#initialize.</p>
502
+ <p>This method takes a hash or an existing Extension object to parse.</p>
487
503
  </div></span>
488
504
 
489
505
  </li>
@@ -572,6 +588,50 @@ access to the components and meaning of the extension's contents.</p>
572
588
 
573
589
 
574
590
 
591
+ <span class="summary_desc"><div class='inline'></div></span>
592
+
593
+ </li>
594
+
595
+
596
+ <li class="public ">
597
+ <span class="summary_signature">
598
+
599
+ <a href="#to_h-instance_method" title="#to_h (instance method)">- (Hash) <strong>to_h</strong> </a>
600
+
601
+
602
+
603
+ </span>
604
+
605
+
606
+
607
+
608
+
609
+
610
+
611
+
612
+
613
+ <span class="summary_desc"><div class='inline'></div></span>
614
+
615
+ </li>
616
+
617
+
618
+ <li class="public ">
619
+ <span class="summary_signature">
620
+
621
+ <a href="#to_yaml-instance_method" title="#to_yaml (instance method)">- (YAML) <strong>to_yaml</strong> </a>
622
+
623
+
624
+
625
+ </span>
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
575
635
  <span class="summary_desc"><div class='inline'></div></span>
576
636
 
577
637
  </li>
@@ -581,13 +641,15 @@ access to the components and meaning of the extension's contents.</p>
581
641
 
582
642
 
583
643
 
644
+
645
+
584
646
  <div id="constructor_details" class="method_details_list">
585
647
  <h2>Constructor Details</h2>
586
648
 
587
649
  <div class="method_details first">
588
650
  <h3 class="signature first" id="initialize-instance_method">
589
651
 
590
- - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::KeyUsage (class)">KeyUsage</a></span></tt>) <strong>initialize</strong>(*args)
652
+ - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::KeyUsage (class)">KeyUsage</a></span></tt>) <strong>initialize</strong>(arg)
591
653
 
592
654
 
593
655
 
@@ -596,13 +658,86 @@ access to the components and meaning of the extension's contents.</p>
596
658
  </h3><div class="docstring">
597
659
  <div class="discussion">
598
660
 
599
- <p>See OpenSSL::X509::Extension#initialize</p>
661
+ <p>This method takes a hash or an existing Extension object to parse</p>
662
+
663
+ <p>The following types are known to r509 by default</p>
664
+
665
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_digitalSignature'>digitalSignature</span>
666
+ <span class='id identifier rubyid_nonRepudiation'>nonRepudiation</span>
667
+ <span class='id identifier rubyid_keyEncipherment'>keyEncipherment</span>
668
+ <span class='id identifier rubyid_dataEncipherment'>dataEncipherment</span>
669
+ <span class='id identifier rubyid_keyAgreement'>keyAgreement</span>
670
+ <span class='id identifier rubyid_keyCertSign'>keyCertSign</span>
671
+ <span class='id identifier rubyid_cRLSign'>cRLSign</span>
672
+ <span class='id identifier rubyid_encipherOnly'>encipherOnly</span>
673
+ <span class='id identifier rubyid_decipherOnly'>decipherOnly</span></code></pre>
600
674
 
601
675
 
602
676
  </div>
603
677
  </div>
604
678
  <div class="tags">
605
679
 
680
+ <div class="examples">
681
+ <p class="tag_title">Examples:</p>
682
+
683
+
684
+ <pre class="example code"><code>R509::Cert::Extensions::KeyUsage.new(
685
+ :critical =&gt; false,
686
+ :value =&gt; [&#39;digitalSignature,&#39;keyEncipherment&#39;]
687
+ )</code></pre>
688
+
689
+ </div>
690
+ <p class="tag_title">Parameters:</p>
691
+ <ul class="param">
692
+
693
+ <li>
694
+
695
+ <span class='name'>arg</span>
696
+
697
+
698
+ <span class='type'>(<tt>Hash</tt>)</span>
699
+
700
+
701
+
702
+ &mdash;
703
+ <div class='inline'>
704
+ <p>a customizable set of options</p>
705
+ </div>
706
+
707
+ </li>
708
+
709
+ </ul>
710
+
711
+
712
+
713
+
714
+ <p class="tag_title">Options Hash (<tt>arg</tt>):</p>
715
+ <ul class="option">
716
+
717
+ <li>
718
+ <span class="name">:value</span>
719
+ <span class="type">(<tt>Array</tt>)</span>
720
+ <span class="default">
721
+
722
+ </span>
723
+
724
+ </li>
725
+
726
+ <li>
727
+ <span class="name">:critical</span>
728
+ <span class="type">(<tt>Boolean</tt>)</span>
729
+ <span class="default">
730
+
731
+ &mdash; default:
732
+ <tt>false</tt>
733
+
734
+ </span>
735
+
736
+ </li>
737
+
738
+ </ul>
739
+
740
+
606
741
 
607
742
  </div><table class="source_code">
608
743
  <tr>
@@ -610,133 +745,25 @@ access to the components and meaning of the extension's contents.</p>
610
745
  <pre class="lines">
611
746
 
612
747
 
613
- 96
614
- 97
615
- 98
616
- 99
617
- 100
618
- 101
619
- 102
620
- 103
621
- 104
622
- 105
623
- 106
624
- 107
625
- 108
626
- 109
627
- 110
628
- 111
629
- 112
630
- 113
631
- 114
632
- 115
633
- 116
634
- 117
635
- 118
636
- 119
637
- 120
638
- 121
639
- 122
640
- 123
641
- 124
642
- 125
643
- 126
644
- 127
645
- 128
646
- 129
647
- 130
648
- 131
649
- 132
650
- 133
651
- 134
652
- 135
653
- 136
654
- 137
655
- 138
656
- 139
657
- 140
658
- 141
659
- 142
660
- 143
661
- 144
662
- 145
663
- 146
664
- 147
665
- 148
666
- 149
667
- 150
668
- 151
669
- 152
670
- 153
671
- 154
672
- 155
673
- 156
674
- 157</pre>
748
+ 71
749
+ 72
750
+ 73
751
+ 74
752
+ 75
753
+ 76
754
+ 77
755
+ 78</pre>
675
756
  </td>
676
757
  <td>
677
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 96</span>
678
-
679
- <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
680
- <span class='kw'>super</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
758
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 71</span>
681
759
 
682
- <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='period'>.</span><span class='id identifier rubyid_get_extension_payload'>get_extension_payload</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
683
-
684
- <span class='comment'># There are 9 possible bits, which means we need 2 bytes
685
- </span> <span class='comment'># to represent them all. When the last bit is not set
686
- </span> <span class='comment'># the second byte is not encoded. let's add it back so we can
687
- </span> <span class='comment'># have the full bitmask for comparison
688
- </span> <span class='kw'>if</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>1</span>
689
- <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\0</span><span class='tstring_end'>&quot;</span></span>
690
- <span class='kw'>end</span>
691
- <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>=</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_unpack'>unpack</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>n</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='comment'># treat it as a 16-bit unsigned big endian
692
- </span> <span class='comment'># KeyUsage ::= BIT STRING {
693
- </span> <span class='comment'># digitalSignature (0),
694
- </span> <span class='comment'># nonRepudiation (1), -- recent editions of X.509 have
695
- </span> <span class='comment'># -- renamed this bit to contentCommitment
696
- </span> <span class='comment'># keyEncipherment (2),
697
- </span> <span class='comment'># dataEncipherment (3),
698
- </span> <span class='comment'># keyAgreement (4),
699
- </span> <span class='comment'># keyCertSign (5),
700
- </span> <span class='comment'># cRLSign (6),
701
- </span> <span class='comment'># encipherOnly (7),
702
- </span> <span class='comment'># decipherOnly (8) }
703
- </span> <span class='ivar'>@allowed_uses</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
704
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b1000000000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
705
- <span class='ivar'>@digital_signature</span> <span class='op'>=</span> <span class='kw'>true</span>
706
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_DIGITAL_SIGNATURE</span>
707
- <span class='kw'>end</span>
708
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0100000000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
709
- <span class='ivar'>@non_repudiation</span> <span class='op'>=</span> <span class='kw'>true</span>
710
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_NON_REPUDIATION</span>
711
- <span class='kw'>end</span>
712
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0010000000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
713
- <span class='ivar'>@key_encipherment</span> <span class='op'>=</span> <span class='kw'>true</span>
714
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_KEY_ENCIPHERMENT</span>
715
- <span class='kw'>end</span>
716
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0001000000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
717
- <span class='ivar'>@data_encipherment</span> <span class='op'>=</span> <span class='kw'>true</span>
718
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_DATA_ENCIPHERMENT</span>
719
- <span class='kw'>end</span>
720
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0000100000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
721
- <span class='ivar'>@key_agreement</span> <span class='op'>=</span> <span class='kw'>true</span>
722
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_KEY_AGREEMENT</span>
723
- <span class='kw'>end</span>
724
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0000010000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
725
- <span class='ivar'>@key_cert_sign</span> <span class='op'>=</span> <span class='kw'>true</span>
726
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_KEY_CERT_SIGN</span>
727
- <span class='kw'>end</span>
728
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0000001000000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
729
- <span class='ivar'>@crl_sign</span> <span class='op'>=</span> <span class='kw'>true</span>
730
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_CRL_SIGN</span>
731
- <span class='kw'>end</span>
732
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0000000100000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
733
- <span class='ivar'>@encipher_only</span> <span class='op'>=</span> <span class='kw'>true</span>
734
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_ENCIPHER_ONLY</span>
735
- <span class='kw'>end</span>
736
- <span class='kw'>if</span> <span class='id identifier rubyid_bit_mask'>bit_mask</span> <span class='op'>&amp;</span> <span class='int'>0b0000000010000000</span> <span class='op'>&gt;</span> <span class='int'>0</span>
737
- <span class='ivar'>@decipher_only</span> <span class='op'>=</span> <span class='kw'>true</span>
738
- <span class='ivar'>@allowed_uses</span> <span class='op'>&lt;&lt;</span> <span class='const'>AU_DECIPHER_ONLY</span>
760
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
761
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Cert</span><span class='op'>::</span><span class='const'>Extensions</span><span class='period'>.</span><span class='id identifier rubyid_is_extension?'>is_extension?</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
762
+ <span class='id identifier rubyid_arg'>arg</span> <span class='op'>=</span> <span class='id identifier rubyid_build_extension'>build_extension</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
739
763
  <span class='kw'>end</span>
764
+
765
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
766
+ <span class='id identifier rubyid_parse_extension'>parse_extension</span>
740
767
  <span class='kw'>end</span></pre>
741
768
  </td>
742
769
  </tr>
@@ -753,7 +780,7 @@ access to the components and meaning of the extension's contents.</p>
753
780
  <div class="method_details first">
754
781
  <h3 class="signature first" id="allowed_uses-instance_method">
755
782
 
756
- - (<tt>Object</tt>) <strong>allowed_uses</strong> <span class="extras">(readonly)</span>
783
+ - (<tt>Array</tt><sup>?</sup>) <strong>allowed_uses</strong> <span class="extras">(readonly)</span>
757
784
 
758
785
 
759
786
 
@@ -762,13 +789,26 @@ access to the components and meaning of the extension's contents.</p>
762
789
  </h3><div class="docstring">
763
790
  <div class="discussion">
764
791
 
765
- <p>An array of the key uses allowed.</p>
792
+ <p>An array (of strings) of the key uses allowed.</p>
766
793
 
767
794
 
768
795
  </div>
769
796
  </div>
770
797
  <div class="tags">
771
798
 
799
+ <p class="tag_title">Returns:</p>
800
+ <ul class="return">
801
+
802
+ <li>
803
+
804
+
805
+ <span class='type'>(<tt>Array</tt>, <tt>nil</tt>)</span>
806
+
807
+
808
+
809
+ </li>
810
+
811
+ </ul>
772
812
 
773
813
  </div><table class="source_code">
774
814
  <tr>
@@ -776,12 +816,12 @@ access to the components and meaning of the extension's contents.</p>
776
816
  <pre class="lines">
777
817
 
778
818
 
779
- 74
780
- 75
781
- 76</pre>
819
+ 30
820
+ 31
821
+ 32</pre>
782
822
  </td>
783
823
  <td>
784
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 74</span>
824
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 30</span>
785
825
 
786
826
  <span class='kw'>def</span> <span class='id identifier rubyid_allowed_uses'>allowed_uses</span>
787
827
  <span class='ivar'>@allowed_uses</span>
@@ -858,12 +898,12 @@ AU_* constants in this class</p>
858
898
  <pre class="lines">
859
899
 
860
900
 
861
- 163
862
- 164
863
- 165</pre>
901
+ 84
902
+ 85
903
+ 86</pre>
864
904
  </td>
865
905
  <td>
866
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 163</span>
906
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 84</span>
867
907
 
868
908
  <span class='kw'>def</span> <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='id identifier rubyid_friendly_use_name'>friendly_use_name</span> <span class='rparen'>)</span>
869
909
  <span class='ivar'>@allowed_uses</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span> <span class='id identifier rubyid_friendly_use_name'>friendly_use_name</span> <span class='rparen'>)</span>
@@ -910,12 +950,12 @@ AU_* constants in this class</p>
910
950
  <pre class="lines">
911
951
 
912
952
 
913
- 191
914
- 192
915
- 193</pre>
953
+ 112
954
+ 113
955
+ 114</pre>
916
956
  </td>
917
957
  <td>
918
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 191</span>
958
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 112</span>
919
959
 
920
960
  <span class='kw'>def</span> <span class='id identifier rubyid_crl_sign?'>crl_sign?</span>
921
961
  <span class='lparen'>(</span><span class='ivar'>@crl_sign</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -962,12 +1002,12 @@ AU_* constants in this class</p>
962
1002
  <pre class="lines">
963
1003
 
964
1004
 
965
- 179
966
- 180
967
- 181</pre>
1005
+ 100
1006
+ 101
1007
+ 102</pre>
968
1008
  </td>
969
1009
  <td>
970
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 179</span>
1010
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 100</span>
971
1011
 
972
1012
  <span class='kw'>def</span> <span class='id identifier rubyid_data_encipherment?'>data_encipherment?</span>
973
1013
  <span class='lparen'>(</span><span class='ivar'>@data_encipherment</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1014,12 +1054,12 @@ AU_* constants in this class</p>
1014
1054
  <pre class="lines">
1015
1055
 
1016
1056
 
1017
- 199
1018
- 200
1019
- 201</pre>
1057
+ 120
1058
+ 121
1059
+ 122</pre>
1020
1060
  </td>
1021
1061
  <td>
1022
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 199</span>
1062
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 120</span>
1023
1063
 
1024
1064
  <span class='kw'>def</span> <span class='id identifier rubyid_decipher_only?'>decipher_only?</span>
1025
1065
  <span class='lparen'>(</span><span class='ivar'>@decipher_only</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1066,12 +1106,12 @@ AU_* constants in this class</p>
1066
1106
  <pre class="lines">
1067
1107
 
1068
1108
 
1069
- 167
1070
- 168
1071
- 169</pre>
1109
+ 88
1110
+ 89
1111
+ 90</pre>
1072
1112
  </td>
1073
1113
  <td>
1074
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 167</span>
1114
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 88</span>
1075
1115
 
1076
1116
  <span class='kw'>def</span> <span class='id identifier rubyid_digital_signature?'>digital_signature?</span>
1077
1117
  <span class='lparen'>(</span><span class='ivar'>@digital_signature</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1118,12 +1158,12 @@ AU_* constants in this class</p>
1118
1158
  <pre class="lines">
1119
1159
 
1120
1160
 
1121
- 195
1122
- 196
1123
- 197</pre>
1161
+ 116
1162
+ 117
1163
+ 118</pre>
1124
1164
  </td>
1125
1165
  <td>
1126
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 195</span>
1166
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 116</span>
1127
1167
 
1128
1168
  <span class='kw'>def</span> <span class='id identifier rubyid_encipher_only?'>encipher_only?</span>
1129
1169
  <span class='lparen'>(</span><span class='ivar'>@encipher_only</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1170,12 +1210,12 @@ AU_* constants in this class</p>
1170
1210
  <pre class="lines">
1171
1211
 
1172
1212
 
1173
- 183
1174
- 184
1175
- 185</pre>
1213
+ 104
1214
+ 105
1215
+ 106</pre>
1176
1216
  </td>
1177
1217
  <td>
1178
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 183</span>
1218
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 104</span>
1179
1219
 
1180
1220
  <span class='kw'>def</span> <span class='id identifier rubyid_key_agreement?'>key_agreement?</span>
1181
1221
  <span class='lparen'>(</span><span class='ivar'>@key_agreement</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1222,12 +1262,12 @@ AU_* constants in this class</p>
1222
1262
  <pre class="lines">
1223
1263
 
1224
1264
 
1225
- 187
1226
- 188
1227
- 189</pre>
1265
+ 108
1266
+ 109
1267
+ 110</pre>
1228
1268
  </td>
1229
1269
  <td>
1230
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 187</span>
1270
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 108</span>
1231
1271
 
1232
1272
  <span class='kw'>def</span> <span class='id identifier rubyid_key_cert_sign?'>key_cert_sign?</span>
1233
1273
  <span class='lparen'>(</span><span class='ivar'>@key_cert_sign</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1274,12 +1314,12 @@ AU_* constants in this class</p>
1274
1314
  <pre class="lines">
1275
1315
 
1276
1316
 
1277
- 175
1278
- 176
1279
- 177</pre>
1317
+ 96
1318
+ 97
1319
+ 98</pre>
1280
1320
  </td>
1281
1321
  <td>
1282
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 175</span>
1322
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 96</span>
1283
1323
 
1284
1324
  <span class='kw'>def</span> <span class='id identifier rubyid_key_encipherment?'>key_encipherment?</span>
1285
1325
  <span class='lparen'>(</span><span class='ivar'>@key_encipherment</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1326,12 +1366,12 @@ AU_* constants in this class</p>
1326
1366
  <pre class="lines">
1327
1367
 
1328
1368
 
1329
- 171
1330
- 172
1331
- 173</pre>
1369
+ 92
1370
+ 93
1371
+ 94</pre>
1332
1372
  </td>
1333
1373
  <td>
1334
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 171</span>
1374
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 92</span>
1335
1375
 
1336
1376
  <span class='kw'>def</span> <span class='id identifier rubyid_non_repudiation?'>non_repudiation?</span>
1337
1377
  <span class='lparen'>(</span><span class='ivar'>@non_repudiation</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
@@ -1339,6 +1379,116 @@ AU_* constants in this class</p>
1339
1379
  </td>
1340
1380
  </tr>
1341
1381
  </table>
1382
+ </div>
1383
+
1384
+ <div class="method_details ">
1385
+ <h3 class="signature " id="to_h-instance_method">
1386
+
1387
+ - (<tt>Hash</tt>) <strong>to_h</strong>
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+ </h3><div class="docstring">
1394
+ <div class="discussion">
1395
+
1396
+
1397
+ </div>
1398
+ </div>
1399
+ <div class="tags">
1400
+
1401
+ <p class="tag_title">Returns:</p>
1402
+ <ul class="return">
1403
+
1404
+ <li>
1405
+
1406
+
1407
+ <span class='type'>(<tt>Hash</tt>)</span>
1408
+
1409
+
1410
+
1411
+ </li>
1412
+
1413
+ </ul>
1414
+
1415
+ </div><table class="source_code">
1416
+ <tr>
1417
+ <td>
1418
+ <pre class="lines">
1419
+
1420
+
1421
+ 125
1422
+ 126
1423
+ 127
1424
+ 128
1425
+ 129
1426
+ 130</pre>
1427
+ </td>
1428
+ <td>
1429
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 125</span>
1430
+
1431
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span>
1432
+ <span class='lbrace'>{</span>
1433
+ <span class='symbol'>:value</span> <span class='op'>=&gt;</span> <span class='ivar'>@allowed_uses</span><span class='comma'>,</span>
1434
+ <span class='symbol'>:critical</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_critical?'>critical?</span>
1435
+ <span class='rbrace'>}</span>
1436
+ <span class='kw'>end</span></pre>
1437
+ </td>
1438
+ </tr>
1439
+ </table>
1440
+ </div>
1441
+
1442
+ <div class="method_details ">
1443
+ <h3 class="signature " id="to_yaml-instance_method">
1444
+
1445
+ - (<tt>YAML</tt>) <strong>to_yaml</strong>
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+ </h3><div class="docstring">
1452
+ <div class="discussion">
1453
+
1454
+
1455
+ </div>
1456
+ </div>
1457
+ <div class="tags">
1458
+
1459
+ <p class="tag_title">Returns:</p>
1460
+ <ul class="return">
1461
+
1462
+ <li>
1463
+
1464
+
1465
+ <span class='type'>(<tt>YAML</tt>)</span>
1466
+
1467
+
1468
+
1469
+ </li>
1470
+
1471
+ </ul>
1472
+
1473
+ </div><table class="source_code">
1474
+ <tr>
1475
+ <td>
1476
+ <pre class="lines">
1477
+
1478
+
1479
+ 133
1480
+ 134
1481
+ 135</pre>
1482
+ </td>
1483
+ <td>
1484
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/key_usage.rb', line 133</span>
1485
+
1486
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_yaml'>to_yaml</span>
1487
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='period'>.</span><span class='id identifier rubyid_to_yaml'>to_yaml</span>
1488
+ <span class='kw'>end</span></pre>
1489
+ </td>
1490
+ </tr>
1491
+ </table>
1342
1492
  </div>
1343
1493
 
1344
1494
  </div>
@@ -1346,9 +1496,9 @@ AU_* constants in this class</p>
1346
1496
  </div>
1347
1497
 
1348
1498
  <div id="footer">
1349
- Generated on Tue Apr 23 10:46:06 2013 by
1499
+ Generated on Sun Jan 26 13:37:27 2014 by
1350
1500
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1351
- 0.8.5 (ruby-1.9.3).
1501
+ 0.8.6.1 (ruby-2.0.0).
1352
1502
  </div>
1353
1503
 
1354
1504
  </body>