r509 0.8.1 → 0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. data/README.md +343 -151
  2. data/Rakefile +26 -23
  3. data/bin/r509 +126 -112
  4. data/bin/r509-parse +24 -24
  5. data/doc/R509.html +169 -7
  6. data/doc/R509/ASN1.html +370 -0
  7. data/doc/R509/ASN1/GeneralName.html +1121 -0
  8. data/doc/R509/ASN1/GeneralNames.html +843 -0
  9. data/doc/R509/ASN1/NoticeReference.html +392 -0
  10. data/doc/R509/ASN1/PolicyInformation.html +387 -0
  11. data/doc/R509/ASN1/PolicyQualifiers.html +455 -0
  12. data/doc/R509/ASN1/UserNotice.html +386 -0
  13. data/doc/R509/{Crl.html → CRL.html} +7 -7
  14. data/doc/R509/CRL/Administrator.html +1559 -0
  15. data/doc/R509/{Crl/Parser.html → CRL/SignedList.html} +501 -210
  16. data/doc/R509/{Csr.html → CSR.html} +444 -314
  17. data/doc/R509/Cert.html +866 -617
  18. data/doc/R509/Cert/Extensions.html +52 -41
  19. data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +70 -35
  20. data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +387 -4
  21. data/doc/R509/Cert/Extensions/BasicConstraints.html +61 -25
  22. data/doc/R509/Cert/Extensions/CRLDistributionPoints.html +354 -0
  23. data/doc/R509/Cert/Extensions/CertificatePolicies.html +340 -0
  24. data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +440 -49
  25. data/doc/R509/Cert/Extensions/{CrlDistributionPoints.html → InhibitAnyPolicy.html} +52 -35
  26. data/doc/R509/Cert/Extensions/KeyUsage.html +247 -121
  27. data/doc/R509/Cert/Extensions/NameConstraints.html +445 -0
  28. data/doc/R509/Cert/Extensions/OCSPNoCheck.html +239 -0
  29. data/doc/R509/Cert/Extensions/PolicyConstraints.html +424 -0
  30. data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +437 -62
  31. data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +52 -10
  32. data/doc/R509/CertificateAuthority.html +4 -4
  33. data/doc/R509/CertificateAuthority/Signer.html +154 -187
  34. data/doc/R509/Config.html +6 -6
  35. data/doc/R509/Config/{CaConfig.html → CAConfig.html} +451 -348
  36. data/doc/R509/Config/{CaConfigPool.html → CAConfigPool.html} +47 -47
  37. data/doc/R509/Config/CAProfile.html +1015 -0
  38. data/doc/R509/Config/SubjectItemPolicy.html +86 -86
  39. data/doc/R509/IOHelpers.html +22 -22
  40. data/doc/R509/MessageDigest.html +14 -14
  41. data/doc/R509/NameSanitizer.html +53 -53
  42. data/doc/R509/{Ocsp.html → OCSP.html} +9 -9
  43. data/doc/R509/{Ocsp → OCSP}/Request.html +7 -7
  44. data/doc/R509/{Ocsp → OCSP}/Request/Nonce.html +56 -11
  45. data/doc/R509/{Ocsp → OCSP}/Response.html +44 -44
  46. data/doc/R509/{OidMapper.html → OIDMapper.html} +23 -39
  47. data/doc/R509/PrivateKey.html +415 -168
  48. data/doc/R509/R509Error.html +3 -3
  49. data/doc/R509/{Spki.html → SPKI.html} +354 -192
  50. data/doc/R509/Subject.html +224 -113
  51. data/doc/R509/Validity.html +27 -5
  52. data/doc/R509/Validity/Checker.html +13 -13
  53. data/doc/R509/Validity/DefaultChecker.html +13 -13
  54. data/doc/R509/Validity/DefaultWriter.html +14 -14
  55. data/doc/R509/Validity/Status.html +39 -39
  56. data/doc/R509/Validity/Writer.html +18 -18
  57. data/doc/_index.html +138 -35
  58. data/doc/class_list.html +1 -1
  59. data/doc/css/style.css +10 -0
  60. data/doc/file.README.html +368 -171
  61. data/doc/file.r509.html +92 -69
  62. data/doc/frames.html +1 -1
  63. data/doc/index.html +368 -171
  64. data/doc/method_list.html +910 -390
  65. data/doc/top-level-namespace.html +3 -3
  66. data/lib/r509.rb +32 -16
  67. data/lib/r509/asn1.rb +375 -0
  68. data/lib/r509/cert.rb +381 -364
  69. data/lib/r509/cert/extensions.rb +443 -76
  70. data/lib/r509/certificate_authority.rb +407 -0
  71. data/lib/r509/config.rb +547 -351
  72. data/lib/r509/crl.rb +336 -366
  73. data/lib/r509/csr.rb +278 -289
  74. data/lib/r509/ec-hack.rb +37 -0
  75. data/lib/r509/exceptions.rb +3 -3
  76. data/lib/r509/io_helpers.rb +44 -44
  77. data/lib/r509/message_digest.rb +53 -0
  78. data/lib/r509/ocsp.rb +80 -70
  79. data/lib/r509/oid_mapper.rb +32 -0
  80. data/lib/r509/private_key.rb +228 -0
  81. data/lib/r509/spki.rb +145 -93
  82. data/lib/r509/subject.rb +203 -110
  83. data/lib/r509/validity.rb +70 -68
  84. data/lib/r509/version.rb +2 -2
  85. data/r509.yaml +92 -69
  86. data/spec/asn1_spec.rb +402 -0
  87. data/spec/cert/extensions_spec.rb +957 -494
  88. data/spec/cert_spec.rb +382 -307
  89. data/spec/certificate_authority_spec.rb +668 -250
  90. data/spec/config_spec.rb +515 -302
  91. data/spec/crl_spec.rb +197 -198
  92. data/spec/csr_spec.rb +334 -289
  93. data/spec/fixtures.rb +247 -171
  94. data/spec/fixtures/cert1.der +0 -0
  95. data/spec/fixtures/cert1.pem +0 -0
  96. data/spec/fixtures/cert1_public_key_modulus.txt +0 -0
  97. data/spec/fixtures/cert3.p12 +0 -0
  98. data/spec/fixtures/cert3.pem +0 -0
  99. data/spec/fixtures/cert3_key.pem +0 -0
  100. data/spec/fixtures/cert3_key_des3.pem +0 -0
  101. data/spec/fixtures/cert4.pem +0 -0
  102. data/spec/fixtures/cert5.pem +0 -0
  103. data/spec/fixtures/cert6.pem +0 -0
  104. data/spec/fixtures/cert_expired.pem +0 -0
  105. data/spec/fixtures/cert_inhibit.pem +24 -0
  106. data/spec/fixtures/cert_name_constraints.pem +29 -0
  107. data/spec/fixtures/cert_not_yet_valid.pem +0 -0
  108. data/spec/fixtures/cert_ocsp_no_check.pem +18 -0
  109. data/spec/fixtures/cert_policy_constraints.pem +31 -0
  110. data/spec/fixtures/cert_san.pem +0 -0
  111. data/spec/fixtures/cert_san2.pem +0 -0
  112. data/spec/fixtures/cert_unknown_extension.pem +28 -0
  113. data/spec/fixtures/config_pool_test_minimal.yaml +11 -11
  114. data/spec/fixtures/config_test.yaml +54 -36
  115. data/spec/fixtures/config_test_dsa.yaml +35 -0
  116. data/spec/fixtures/config_test_ec.yaml +35 -0
  117. data/spec/fixtures/config_test_engine_key.yaml +5 -5
  118. data/spec/fixtures/config_test_engine_no_key_name.yaml +4 -4
  119. data/spec/fixtures/config_test_minimal.yaml +4 -4
  120. data/spec/fixtures/config_test_password.yaml +5 -5
  121. data/spec/fixtures/config_test_various.yaml +111 -74
  122. data/spec/fixtures/crl_list_file.txt +0 -0
  123. data/spec/fixtures/crl_with_reason.pem +0 -0
  124. data/spec/fixtures/csr1.der +0 -0
  125. data/spec/fixtures/csr1.pem +0 -0
  126. data/spec/fixtures/csr1_key.der +0 -0
  127. data/spec/fixtures/csr1_key.pem +0 -0
  128. data/spec/fixtures/csr1_key_encrypted_des3.pem +0 -0
  129. data/spec/fixtures/csr1_newlines.pem +0 -0
  130. data/spec/fixtures/csr1_no_begin_end.pem +0 -0
  131. data/spec/fixtures/csr1_public_key_modulus.txt +0 -0
  132. data/spec/fixtures/csr2.pem +0 -0
  133. data/spec/fixtures/csr2_key.pem +0 -0
  134. data/spec/fixtures/csr3.pem +0 -0
  135. data/spec/fixtures/csr4.pem +0 -0
  136. data/spec/fixtures/csr_dsa.pem +0 -0
  137. data/spec/fixtures/csr_invalid_signature.pem +0 -0
  138. data/spec/fixtures/dsa_key.pem +0 -0
  139. data/spec/fixtures/dsa_root.cer +28 -0
  140. data/spec/fixtures/dsa_root.key +20 -0
  141. data/spec/fixtures/ec_csr2.der +0 -0
  142. data/spec/fixtures/ec_csr2.pem +8 -0
  143. data/spec/fixtures/ec_key1.der +0 -0
  144. data/spec/fixtures/ec_key1.pem +6 -0
  145. data/spec/fixtures/ec_key1_encrypted.pem +9 -0
  146. data/spec/fixtures/ec_key2.pem +6 -0
  147. data/spec/fixtures/hmacsha1.sig +1 -0
  148. data/spec/fixtures/hmacsha512.sig +1 -0
  149. data/spec/fixtures/key4.pem +0 -0
  150. data/spec/fixtures/key4_encrypted_des3.pem +0 -0
  151. data/spec/fixtures/missing_key_identifier_ca.cer +0 -0
  152. data/spec/fixtures/missing_key_identifier_ca.key +0 -0
  153. data/spec/fixtures/ocsptest.r509.local.pem +0 -0
  154. data/spec/fixtures/ocsptest.r509.local_ocsp_request.der +0 -0
  155. data/spec/fixtures/ocsptest2.r509.local.pem +0 -0
  156. data/spec/fixtures/second_ca.cer +0 -0
  157. data/spec/fixtures/second_ca.key +0 -0
  158. data/spec/fixtures/spkac.der +0 -0
  159. data/spec/fixtures/spkac.txt +0 -0
  160. data/spec/fixtures/spkac_dsa.txt +1 -1
  161. data/spec/fixtures/spkac_dsa_no_verify.txt +1 -0
  162. data/spec/fixtures/spkac_ec.txt +1 -0
  163. data/spec/fixtures/spkac_rsa_newlines.txt +13 -0
  164. data/spec/fixtures/stca.pem +0 -0
  165. data/spec/fixtures/stca_ocsp_request.der +0 -0
  166. data/spec/fixtures/stca_ocsp_response.der +0 -0
  167. data/spec/fixtures/test1.csr +0 -0
  168. data/spec/fixtures/test_ca.cer +0 -0
  169. data/spec/fixtures/test_ca.key +0 -0
  170. data/spec/fixtures/test_ca.p12 +0 -0
  171. data/spec/fixtures/test_ca_des3.key +0 -0
  172. data/spec/fixtures/test_ca_ec.cer +14 -0
  173. data/spec/fixtures/test_ca_ec.key +6 -0
  174. data/spec/fixtures/test_ca_ec_ee.cer +22 -0
  175. data/spec/fixtures/test_ca_ec_ee.key +6 -0
  176. data/spec/fixtures/test_ca_ocsp.cer +0 -0
  177. data/spec/fixtures/test_ca_ocsp.key +0 -0
  178. data/spec/fixtures/test_ca_ocsp.p12 +0 -0
  179. data/spec/fixtures/test_ca_ocsp_chain.txt +0 -0
  180. data/spec/fixtures/test_ca_ocsp_response.der +0 -0
  181. data/spec/fixtures/test_ca_subroot.cer +0 -0
  182. data/spec/fixtures/test_ca_subroot.key +0 -0
  183. data/spec/fixtures/test_ca_subroot_ocsp.cer +0 -0
  184. data/spec/fixtures/test_ca_subroot_ocsp.key +0 -0
  185. data/spec/fixtures/test_ca_subroot_ocsp_response.der +0 -0
  186. data/spec/fixtures/unknown_oid.csr +0 -0
  187. data/spec/message_digest_spec.rb +104 -84
  188. data/spec/ocsp_spec.rb +105 -105
  189. data/spec/oid_mapper_spec.rb +21 -21
  190. data/spec/private_key_spec.rb +275 -0
  191. data/spec/r509_spec.rb +35 -0
  192. data/spec/spec_helper.rb +15 -6
  193. data/spec/spki_spec.rb +221 -142
  194. data/spec/subject_spec.rb +232 -164
  195. data/spec/validity_spec.rb +91 -91
  196. metadata +79 -25
  197. data/doc/R509/Config/CaProfile.html +0 -651
  198. data/doc/R509/Crl/Administrator.html +0 -2073
  199. data/lib/r509/certificateauthority.rb +0 -290
  200. data/lib/r509/messagedigest.rb +0 -49
  201. data/lib/r509/oidmapper.rb +0 -32
  202. data/lib/r509/privatekey.rb +0 -185
  203. data/spec/privatekey_spec.rb +0 -198
@@ -4,9 +4,9 @@
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
6
  <title>
7
- Class: R509::Cert::Extensions::CrlDistributionPoints
7
+ Class: R509::Cert::Extensions::InhibitAnyPolicy
8
8
 
9
- &mdash; Documentation by YARD 0.8.2.1
9
+ &mdash; Documentation by YARD 0.8.5
10
10
 
11
11
  </title>
12
12
 
@@ -31,10 +31,10 @@
31
31
  <div id="header">
32
32
  <div id="menu">
33
33
 
34
- <a href="../../../_index.html">Index (C)</a> &raquo;
34
+ <a href="../../../_index.html">Index (I)</a> &raquo;
35
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="../../Cert.html" title="R509::Cert (class)">Cert</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Extensions.html" title="R509::Cert::Extensions (module)">Extensions</a></span></span>
36
36
  &raquo;
37
- <span class="title">CrlDistributionPoints</span>
37
+ <span class="title">InhibitAnyPolicy</span>
38
38
 
39
39
 
40
40
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
@@ -63,7 +63,7 @@
63
63
 
64
64
  <iframe id="search_frame"></iframe>
65
65
 
66
- <div id="content"><h1>Class: R509::Cert::Extensions::CrlDistributionPoints
66
+ <div id="content"><h1>Class: R509::Cert::Extensions::InhibitAnyPolicy
67
67
 
68
68
 
69
69
 
@@ -80,7 +80,7 @@
80
80
 
81
81
  <li class="next">OpenSSL::X509::Extension</li>
82
82
 
83
- <li class="next">R509::Cert::Extensions::CrlDistributionPoints</li>
83
+ <li class="next">R509::Cert::Extensions::InhibitAnyPolicy</li>
84
84
 
85
85
  </ul>
86
86
  <a href="#" class="inheritanceTree">show all</a>
@@ -104,8 +104,8 @@
104
104
  <h2>Overview</h2><div class="docstring">
105
105
  <div class="discussion">
106
106
 
107
- <p>Implements the CrlDistributionPoints certificate extension, with methods to
108
- provide access to the components and meaning of the extension's contents.</p>
107
+ <p>Implements the InhibitAnyPolicy certificate extension, with methods to
108
+ provide access to the component and meaning of the extension's contents.</p>
109
109
 
110
110
 
111
111
  </div>
@@ -119,9 +119,20 @@ provide access to the components and meaning of the extension's contents.</p>
119
119
  <dl class="constants">
120
120
 
121
121
  <dt id="OID-constant" class="">OID =
122
-
122
+ <div class="docstring">
123
+ <div class="discussion">
124
+
125
+ <p>friendly name for CP OID</p>
126
+
127
+
128
+ </div>
129
+ </div>
130
+ <div class="tags">
131
+
132
+
133
+ </div>
123
134
  </dt>
124
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>crlDistributionPoints</span><span class='tstring_end'>&quot;</span></span></pre></dd>
135
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>inhibitAnyPolicy</span><span class='tstring_end'>&quot;</span></span></pre></dd>
125
136
 
126
137
  </dl>
127
138
 
@@ -135,7 +146,7 @@ provide access to the components and meaning of the extension's contents.</p>
135
146
  <li class="public ">
136
147
  <span class="summary_signature">
137
148
 
138
- <a href="#crl_uris-instance_method" title="#crl_uris (instance method)">- (Object) <strong>crl_uris</strong> </a>
149
+ <a href="#skip_certs-instance_method" title="#skip_certs (instance method)">- (Object) <strong>skip_certs</strong> </a>
139
150
 
140
151
 
141
152
 
@@ -155,7 +166,7 @@ provide access to the components and meaning of the extension's contents.</p>
155
166
 
156
167
 
157
168
  <span class="summary_desc"><div class='inline'>
158
- <p>An array of the CRL URIs, if any.</p>
169
+ <p>Returns the value of attribute skip_certs.</p>
159
170
  </div></span>
160
171
 
161
172
  </li>
@@ -177,7 +188,7 @@ provide access to the components and meaning of the extension's contents.</p>
177
188
  <li class="public ">
178
189
  <span class="summary_signature">
179
190
 
180
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (CrlDistributionPoints) <strong>initialize</strong>(*args) </a>
191
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (InhibitAnyPolicy) <strong>initialize</strong>(*args) </a>
181
192
 
182
193
 
183
194
 
@@ -194,7 +205,7 @@ provide access to the components and meaning of the extension's contents.</p>
194
205
 
195
206
 
196
207
  <span class="summary_desc"><div class='inline'>
197
- <p>See OpenSSL::X509::Extension#initialize.</p>
208
+ <p>A new instance of InhibitAnyPolicy.</p>
198
209
  </div></span>
199
210
 
200
211
  </li>
@@ -210,7 +221,7 @@ provide access to the components and meaning of the extension's contents.</p>
210
221
  <div class="method_details first">
211
222
  <h3 class="signature first" id="initialize-instance_method">
212
223
 
213
- - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::CrlDistributionPoints (class)">CrlDistributionPoints</a></span></tt>) <strong>initialize</strong>(*args)
224
+ - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::InhibitAnyPolicy (class)">InhibitAnyPolicy</a></span></tt>) <strong>initialize</strong>(*args)
214
225
 
215
226
 
216
227
 
@@ -219,7 +230,7 @@ provide access to the components and meaning of the extension's contents.</p>
219
230
  </h3><div class="docstring">
220
231
  <div class="discussion">
221
232
 
222
- <p>See OpenSSL::X509::Extension#initialize</p>
233
+ <p>A new instance of InhibitAnyPolicy</p>
223
234
 
224
235
 
225
236
  </div>
@@ -233,20 +244,26 @@ provide access to the components and meaning of the extension's contents.</p>
233
244
  <pre class="lines">
234
245
 
235
246
 
236
- 254
237
- 255
238
- 256
239
- 257
240
- 258</pre>
247
+ 539
248
+ 540
249
+ 541
250
+ 542
251
+ 543
252
+ 544
253
+ 545
254
+ 546</pre>
241
255
  </td>
242
256
  <td>
243
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 254</span>
257
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 539</span>
244
258
 
245
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>
246
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>
247
261
 
248
- <span class='ivar'>@crl_uris</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_scan'>scan</span><span class='lparen'>(</span> <span class='const'>URI_REGEX</span> <span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='id identifier rubyid_match'>match</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='rbrace'>}</span>
249
- <span class='kw'>end</span></pre>
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>
250
267
  </td>
251
268
  </tr>
252
269
  </table>
@@ -260,9 +277,9 @@ provide access to the components and meaning of the extension's contents.</p>
260
277
 
261
278
  <span id=""></span>
262
279
  <div class="method_details first">
263
- <h3 class="signature first" id="crl_uris-instance_method">
280
+ <h3 class="signature first" id="skip_certs-instance_method">
264
281
 
265
- - (<tt>Object</tt>) <strong>crl_uris</strong> <span class="extras">(readonly)</span>
282
+ - (<tt>Object</tt>) <strong>skip_certs</strong> <span class="extras">(readonly)</span>
266
283
 
267
284
 
268
285
 
@@ -271,7 +288,7 @@ provide access to the components and meaning of the extension's contents.</p>
271
288
  </h3><div class="docstring">
272
289
  <div class="discussion">
273
290
 
274
- <p>An array of the CRL URIs, if any</p>
291
+ <p>Returns the value of attribute skip_certs</p>
275
292
 
276
293
 
277
294
  </div>
@@ -285,15 +302,15 @@ provide access to the components and meaning of the extension's contents.</p>
285
302
  <pre class="lines">
286
303
 
287
304
 
288
- 251
289
- 252
290
- 253</pre>
305
+ 537
306
+ 538
307
+ 539</pre>
291
308
  </td>
292
309
  <td>
293
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 251</span>
310
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 537</span>
294
311
 
295
- <span class='kw'>def</span> <span class='id identifier rubyid_crl_uris'>crl_uris</span>
296
- <span class='ivar'>@crl_uris</span>
312
+ <span class='kw'>def</span> <span class='id identifier rubyid_skip_certs'>skip_certs</span>
313
+ <span class='ivar'>@skip_certs</span>
297
314
  <span class='kw'>end</span></pre>
298
315
  </td>
299
316
  </tr>
@@ -306,9 +323,9 @@ provide access to the components and meaning of the extension's contents.</p>
306
323
  </div>
307
324
 
308
325
  <div id="footer">
309
- Generated on Thu Nov 8 14:19:29 2012 by
326
+ Generated on Tue Apr 16 10:49:58 2013 by
310
327
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
311
- 0.8.2.1 (ruby-1.9.3).
328
+ 0.8.5 (ruby-1.9.3).
312
329
  </div>
313
330
 
314
331
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: R509::Cert::Extensions::KeyUsage
8
8
 
9
- &mdash; Documentation by YARD 0.8.2.1
9
+ &mdash; Documentation by YARD 0.8.5
10
10
 
11
11
  </title>
12
12
 
@@ -119,7 +119,18 @@ access to the components and meaning of the extension's contents.</p>
119
119
  <dl class="constants">
120
120
 
121
121
  <dt id="OID-constant" class="">OID =
122
-
122
+ <div class="docstring">
123
+ <div class="discussion">
124
+
125
+ <p>friendly name for KeyUsage OID</p>
126
+
127
+
128
+ </div>
129
+ </div>
130
+ <div class="tags">
131
+
132
+
133
+ </div>
123
134
  </dt>
124
135
  <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>keyUsage</span><span class='tstring_end'>&quot;</span></span></pre></dd>
125
136
 
@@ -127,7 +138,7 @@ access to the components and meaning of the extension's contents.</p>
127
138
  <div class="docstring">
128
139
  <div class="discussion">
129
140
 
130
- <p>The OpenSSL friendly name for the "digitalSignature" key use.</p>
141
+ <p>OpenSSL short name for Digital Signature</p>
131
142
 
132
143
 
133
144
  </div>
@@ -137,13 +148,13 @@ access to the components and meaning of the extension's contents.</p>
137
148
 
138
149
  </div>
139
150
  </dt>
140
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Digital Signature</span><span class='tstring_end'>&quot;</span></span></pre></dd>
151
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>digitalSignature</span><span class='tstring_end'>&quot;</span></span></pre></dd>
141
152
 
142
153
  <dt id="AU_NON_REPUDIATION-constant" class="">AU_NON_REPUDIATION =
143
154
  <div class="docstring">
144
155
  <div class="discussion">
145
156
 
146
- <p>The OpenSSL friendly name for the "nonRepudiation" key use.</p>
157
+ <p>OpenSSL short name for Non Repudiation (also known as content commitment)</p>
147
158
 
148
159
 
149
160
  </div>
@@ -153,13 +164,13 @@ access to the components and meaning of the extension's contents.</p>
153
164
 
154
165
  </div>
155
166
  </dt>
156
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Non Repudiation</span><span class='tstring_end'>&quot;</span></span></pre></dd>
167
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>nonRepudiation</span><span class='tstring_end'>&quot;</span></span></pre></dd>
157
168
 
158
169
  <dt id="AU_KEY_ENCIPHERMENT-constant" class="">AU_KEY_ENCIPHERMENT =
159
170
  <div class="docstring">
160
171
  <div class="discussion">
161
172
 
162
- <p>The OpenSSL friendly name for the "keyEncipherment" key use.</p>
173
+ <p>OpenSSL short name for Key Encipherment</p>
163
174
 
164
175
 
165
176
  </div>
@@ -169,13 +180,13 @@ access to the components and meaning of the extension's contents.</p>
169
180
 
170
181
  </div>
171
182
  </dt>
172
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Key Encipherment</span><span class='tstring_end'>&quot;</span></span></pre></dd>
183
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>keyEncipherment</span><span class='tstring_end'>&quot;</span></span></pre></dd>
173
184
 
174
185
  <dt id="AU_DATA_ENCIPHERMENT-constant" class="">AU_DATA_ENCIPHERMENT =
175
186
  <div class="docstring">
176
187
  <div class="discussion">
177
188
 
178
- <p>The OpenSSL friendly name for the "dataEncipherment" key use.</p>
189
+ <p>OpenSSL short name for Data Encipherment</p>
179
190
 
180
191
 
181
192
  </div>
@@ -185,13 +196,13 @@ access to the components and meaning of the extension's contents.</p>
185
196
 
186
197
  </div>
187
198
  </dt>
188
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Data Encipherment</span><span class='tstring_end'>&quot;</span></span></pre></dd>
199
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>dataEncipherment</span><span class='tstring_end'>&quot;</span></span></pre></dd>
189
200
 
190
201
  <dt id="AU_KEY_AGREEMENT-constant" class="">AU_KEY_AGREEMENT =
191
202
  <div class="docstring">
192
203
  <div class="discussion">
193
204
 
194
- <p>The OpenSSL friendly name for the "keyAgreement" key use.</p>
205
+ <p>OpenSSL short name for Key Agreement</p>
195
206
 
196
207
 
197
208
  </div>
@@ -201,13 +212,13 @@ access to the components and meaning of the extension's contents.</p>
201
212
 
202
213
  </div>
203
214
  </dt>
204
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Key Agreement</span><span class='tstring_end'>&quot;</span></span></pre></dd>
215
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>keyAgreement</span><span class='tstring_end'>&quot;</span></span></pre></dd>
205
216
 
206
- <dt id="AU_CERTIFICATE_SIGN-constant" class="">AU_CERTIFICATE_SIGN =
217
+ <dt id="AU_KEY_CERT_SIGN-constant" class="">AU_KEY_CERT_SIGN =
207
218
  <div class="docstring">
208
219
  <div class="discussion">
209
220
 
210
- <p>The OpenSSL friendly name for the "keyCertSign" key use.</p>
221
+ <p>OpenSSL short name for Certificate Sign</p>
211
222
 
212
223
 
213
224
  </div>
@@ -217,13 +228,13 @@ access to the components and meaning of the extension's contents.</p>
217
228
 
218
229
  </div>
219
230
  </dt>
220
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Certificate Sign</span><span class='tstring_end'>&quot;</span></span></pre></dd>
231
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>keyCertSign</span><span class='tstring_end'>&quot;</span></span></pre></dd>
221
232
 
222
233
  <dt id="AU_CRL_SIGN-constant" class="">AU_CRL_SIGN =
223
234
  <div class="docstring">
224
235
  <div class="discussion">
225
236
 
226
- <p>The OpenSSL friendly name for the "cRLSign" key use.</p>
237
+ <p>OpenSSL short name for CRL Sign</p>
227
238
 
228
239
 
229
240
  </div>
@@ -233,13 +244,13 @@ access to the components and meaning of the extension's contents.</p>
233
244
 
234
245
  </div>
235
246
  </dt>
236
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CRL Sign</span><span class='tstring_end'>&quot;</span></span></pre></dd>
247
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>cRLSign</span><span class='tstring_end'>&quot;</span></span></pre></dd>
237
248
 
238
249
  <dt id="AU_ENCIPHER_ONLY-constant" class="">AU_ENCIPHER_ONLY =
239
250
  <div class="docstring">
240
251
  <div class="discussion">
241
252
 
242
- <p>The OpenSSL friendly name for the "encipherOnly" key use.</p>
253
+ <p>OpenSSL short name for Encipher Only</p>
243
254
 
244
255
 
245
256
  </div>
@@ -249,13 +260,13 @@ access to the components and meaning of the extension's contents.</p>
249
260
 
250
261
  </div>
251
262
  </dt>
252
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Encipher Only</span><span class='tstring_end'>&quot;</span></span></pre></dd>
263
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>encipherOnly</span><span class='tstring_end'>&quot;</span></span></pre></dd>
253
264
 
254
265
  <dt id="AU_DECIPHER_ONLY-constant" class="">AU_DECIPHER_ONLY =
255
266
  <div class="docstring">
256
267
  <div class="discussion">
257
268
 
258
- <p>The OpenSSL friendly name for the "decipherOnly" key use.</p>
269
+ <p>OpenSSL short name for Decipher Only</p>
259
270
 
260
271
 
261
272
  </div>
@@ -265,7 +276,7 @@ access to the components and meaning of the extension's contents.</p>
265
276
 
266
277
  </div>
267
278
  </dt>
268
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Decipher Only</span><span class='tstring_end'>&quot;</span></span></pre></dd>
279
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>decipherOnly</span><span class='tstring_end'>&quot;</span></span></pre></dd>
269
280
 
270
281
  </dl>
271
282
 
@@ -345,7 +356,7 @@ access to the components and meaning of the extension's contents.</p>
345
356
  <li class="public ">
346
357
  <span class="summary_signature">
347
358
 
348
- <a href="#certificate_sign%3F-instance_method" title="#certificate_sign? (instance method)">- (Boolean) <strong>certificate_sign?</strong> </a>
359
+ <a href="#crl_sign%3F-instance_method" title="#crl_sign? (instance method)">- (Boolean) <strong>crl_sign?</strong> </a>
349
360
 
350
361
 
351
362
 
@@ -367,7 +378,7 @@ access to the components and meaning of the extension's contents.</p>
367
378
  <li class="public ">
368
379
  <span class="summary_signature">
369
380
 
370
- <a href="#crl_sign%3F-instance_method" title="#crl_sign? (instance method)">- (Boolean) <strong>crl_sign?</strong> </a>
381
+ <a href="#data_encipherment%3F-instance_method" title="#data_encipherment? (instance method)">- (Boolean) <strong>data_encipherment?</strong> </a>
371
382
 
372
383
 
373
384
 
@@ -389,7 +400,7 @@ access to the components and meaning of the extension's contents.</p>
389
400
  <li class="public ">
390
401
  <span class="summary_signature">
391
402
 
392
- <a href="#data_encipherment%3F-instance_method" title="#data_encipherment? (instance method)">- (Boolean) <strong>data_encipherment?</strong> </a>
403
+ <a href="#decipher_only%3F-instance_method" title="#decipher_only? (instance method)">- (Boolean) <strong>decipher_only?</strong> </a>
393
404
 
394
405
 
395
406
 
@@ -411,7 +422,7 @@ access to the components and meaning of the extension's contents.</p>
411
422
  <li class="public ">
412
423
  <span class="summary_signature">
413
424
 
414
- <a href="#decipher_only%3F-instance_method" title="#decipher_only? (instance method)">- (Boolean) <strong>decipher_only?</strong> </a>
425
+ <a href="#digital_signature%3F-instance_method" title="#digital_signature? (instance method)">- (Boolean) <strong>digital_signature?</strong> </a>
415
426
 
416
427
 
417
428
 
@@ -433,7 +444,7 @@ access to the components and meaning of the extension's contents.</p>
433
444
  <li class="public ">
434
445
  <span class="summary_signature">
435
446
 
436
- <a href="#digital_signature%3F-instance_method" title="#digital_signature? (instance method)">- (Boolean) <strong>digital_signature?</strong> </a>
447
+ <a href="#encipher_only%3F-instance_method" title="#encipher_only? (instance method)">- (Boolean) <strong>encipher_only?</strong> </a>
437
448
 
438
449
 
439
450
 
@@ -455,13 +466,15 @@ access to the components and meaning of the extension's contents.</p>
455
466
  <li class="public ">
456
467
  <span class="summary_signature">
457
468
 
458
- <a href="#encipher_only%3F-instance_method" title="#encipher_only? (instance method)">- (Boolean) <strong>encipher_only?</strong> </a>
469
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (KeyUsage) <strong>initialize</strong>(*args) </a>
459
470
 
460
471
 
461
472
 
462
473
  </span>
463
474
 
464
475
 
476
+ <span class="note title constructor">constructor</span>
477
+
465
478
 
466
479
 
467
480
 
@@ -469,7 +482,9 @@ access to the components and meaning of the extension's contents.</p>
469
482
 
470
483
 
471
484
 
472
- <span class="summary_desc"><div class='inline'></div></span>
485
+ <span class="summary_desc"><div class='inline'>
486
+ <p>See OpenSSL::X509::Extension#initialize.</p>
487
+ </div></span>
473
488
 
474
489
  </li>
475
490
 
@@ -477,15 +492,13 @@ access to the components and meaning of the extension's contents.</p>
477
492
  <li class="public ">
478
493
  <span class="summary_signature">
479
494
 
480
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (KeyUsage) <strong>initialize</strong>(*args) </a>
495
+ <a href="#key_agreement%3F-instance_method" title="#key_agreement? (instance method)">- (Boolean) <strong>key_agreement?</strong> </a>
481
496
 
482
497
 
483
498
 
484
499
  </span>
485
500
 
486
501
 
487
- <span class="note title constructor">constructor</span>
488
-
489
502
 
490
503
 
491
504
 
@@ -493,9 +506,7 @@ access to the components and meaning of the extension's contents.</p>
493
506
 
494
507
 
495
508
 
496
- <span class="summary_desc"><div class='inline'>
497
- <p>See OpenSSL::X509::Extension#initialize.</p>
498
- </div></span>
509
+ <span class="summary_desc"><div class='inline'></div></span>
499
510
 
500
511
  </li>
501
512
 
@@ -503,7 +514,7 @@ access to the components and meaning of the extension's contents.</p>
503
514
  <li class="public ">
504
515
  <span class="summary_signature">
505
516
 
506
- <a href="#key_agreement%3F-instance_method" title="#key_agreement? (instance method)">- (Boolean) <strong>key_agreement?</strong> </a>
517
+ <a href="#key_cert_sign%3F-instance_method" title="#key_cert_sign? (instance method)">- (Boolean) <strong>key_cert_sign?</strong> </a>
507
518
 
508
519
 
509
520
 
@@ -599,19 +610,133 @@ access to the components and meaning of the extension's contents.</p>
599
610
  <pre class="lines">
600
611
 
601
612
 
602
- 83
603
- 84
604
- 85
605
- 86
606
- 87</pre>
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>
607
675
  </td>
608
676
  <td>
609
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 83</span>
677
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 96</span>
610
678
 
611
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>
612
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>
613
681
 
614
- <span class='ivar'>@allowed_uses</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>,</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_use'>use</span><span class='op'>|</span> <span class='id identifier rubyid_use'>use</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span><span class='rbrace'>}</span>
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>
739
+ <span class='kw'>end</span>
615
740
  <span class='kw'>end</span></pre>
616
741
  </td>
617
742
  </tr>
@@ -637,7 +762,7 @@ access to the components and meaning of the extension's contents.</p>
637
762
  </h3><div class="docstring">
638
763
  <div class="discussion">
639
764
 
640
- <p>An array of the key uses allowed. See the AU_* constants in this class.</p>
765
+ <p>An array of the key uses allowed.</p>
641
766
 
642
767
 
643
768
  </div>
@@ -651,12 +776,12 @@ access to the components and meaning of the extension's contents.</p>
651
776
  <pre class="lines">
652
777
 
653
778
 
654
- 80
655
- 81
656
- 82</pre>
779
+ 74
780
+ 75
781
+ 76</pre>
657
782
  </td>
658
783
  <td>
659
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 80</span>
784
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 74</span>
660
785
 
661
786
  <span class='kw'>def</span> <span class='id identifier rubyid_allowed_uses'>allowed_uses</span>
662
787
  <span class='ivar'>@allowed_uses</span>
@@ -699,13 +824,14 @@ access to the components and meaning of the extension's contents.</p>
699
824
  <span class='name'>friendly_use_name</span>
700
825
 
701
826
 
702
- <span class='type'>(<tt>string</tt>)</span>
827
+ <span class='type'>(<tt>String</tt>)</span>
703
828
 
704
829
 
705
830
 
706
831
  &mdash;
707
832
  <div class='inline'>
708
- <p>One of the AU_* constants in this class.</p>
833
+ <p>key usage short name (e.g. digitalSignature, cRLSign, etc) or one of the
834
+ AU_* constants in this class</p>
709
835
  </div>
710
836
 
711
837
  </li>
@@ -732,12 +858,12 @@ access to the components and meaning of the extension's contents.</p>
732
858
  <pre class="lines">
733
859
 
734
860
 
735
- 91
736
- 92
737
- 93</pre>
861
+ 163
862
+ 164
863
+ 165</pre>
738
864
  </td>
739
865
  <td>
740
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 91</span>
866
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 163</span>
741
867
 
742
868
  <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>
743
869
  <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>
@@ -748,9 +874,9 @@ access to the components and meaning of the extension's contents.</p>
748
874
  </div>
749
875
 
750
876
  <div class="method_details ">
751
- <h3 class="signature " id="certificate_sign?-instance_method">
877
+ <h3 class="signature " id="crl_sign?-instance_method">
752
878
 
753
- - (<tt>Boolean</tt>) <strong>certificate_sign?</strong>
879
+ - (<tt>Boolean</tt>) <strong>crl_sign?</strong>
754
880
 
755
881
 
756
882
 
@@ -784,15 +910,15 @@ access to the components and meaning of the extension's contents.</p>
784
910
  <pre class="lines">
785
911
 
786
912
 
787
- 115
788
- 116
789
- 117</pre>
913
+ 191
914
+ 192
915
+ 193</pre>
790
916
  </td>
791
917
  <td>
792
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 115</span>
918
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 191</span>
793
919
 
794
- <span class='kw'>def</span> <span class='id identifier rubyid_certificate_sign?'>certificate_sign?</span>
795
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_CERTIFICATE_SIGN</span> <span class='rparen'>)</span>
920
+ <span class='kw'>def</span> <span class='id identifier rubyid_crl_sign?'>crl_sign?</span>
921
+ <span class='lparen'>(</span><span class='ivar'>@crl_sign</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
796
922
  <span class='kw'>end</span></pre>
797
923
  </td>
798
924
  </tr>
@@ -800,9 +926,9 @@ access to the components and meaning of the extension's contents.</p>
800
926
  </div>
801
927
 
802
928
  <div class="method_details ">
803
- <h3 class="signature " id="crl_sign?-instance_method">
929
+ <h3 class="signature " id="data_encipherment?-instance_method">
804
930
 
805
- - (<tt>Boolean</tt>) <strong>crl_sign?</strong>
931
+ - (<tt>Boolean</tt>) <strong>data_encipherment?</strong>
806
932
 
807
933
 
808
934
 
@@ -836,15 +962,15 @@ access to the components and meaning of the extension's contents.</p>
836
962
  <pre class="lines">
837
963
 
838
964
 
839
- 119
840
- 120
841
- 121</pre>
965
+ 179
966
+ 180
967
+ 181</pre>
842
968
  </td>
843
969
  <td>
844
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 119</span>
970
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 179</span>
845
971
 
846
- <span class='kw'>def</span> <span class='id identifier rubyid_crl_sign?'>crl_sign?</span>
847
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_CRL_SIGN</span> <span class='rparen'>)</span>
972
+ <span class='kw'>def</span> <span class='id identifier rubyid_data_encipherment?'>data_encipherment?</span>
973
+ <span class='lparen'>(</span><span class='ivar'>@data_encipherment</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
848
974
  <span class='kw'>end</span></pre>
849
975
  </td>
850
976
  </tr>
@@ -852,9 +978,9 @@ access to the components and meaning of the extension's contents.</p>
852
978
  </div>
853
979
 
854
980
  <div class="method_details ">
855
- <h3 class="signature " id="data_encipherment?-instance_method">
981
+ <h3 class="signature " id="decipher_only?-instance_method">
856
982
 
857
- - (<tt>Boolean</tt>) <strong>data_encipherment?</strong>
983
+ - (<tt>Boolean</tt>) <strong>decipher_only?</strong>
858
984
 
859
985
 
860
986
 
@@ -888,15 +1014,15 @@ access to the components and meaning of the extension's contents.</p>
888
1014
  <pre class="lines">
889
1015
 
890
1016
 
891
- 107
892
- 108
893
- 109</pre>
1017
+ 199
1018
+ 200
1019
+ 201</pre>
894
1020
  </td>
895
1021
  <td>
896
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 107</span>
1022
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 199</span>
897
1023
 
898
- <span class='kw'>def</span> <span class='id identifier rubyid_data_encipherment?'>data_encipherment?</span>
899
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_DATA_ENCIPHERMENT</span> <span class='rparen'>)</span>
1024
+ <span class='kw'>def</span> <span class='id identifier rubyid_decipher_only?'>decipher_only?</span>
1025
+ <span class='lparen'>(</span><span class='ivar'>@decipher_only</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
900
1026
  <span class='kw'>end</span></pre>
901
1027
  </td>
902
1028
  </tr>
@@ -904,9 +1030,9 @@ access to the components and meaning of the extension's contents.</p>
904
1030
  </div>
905
1031
 
906
1032
  <div class="method_details ">
907
- <h3 class="signature " id="decipher_only?-instance_method">
1033
+ <h3 class="signature " id="digital_signature?-instance_method">
908
1034
 
909
- - (<tt>Boolean</tt>) <strong>decipher_only?</strong>
1035
+ - (<tt>Boolean</tt>) <strong>digital_signature?</strong>
910
1036
 
911
1037
 
912
1038
 
@@ -940,15 +1066,15 @@ access to the components and meaning of the extension's contents.</p>
940
1066
  <pre class="lines">
941
1067
 
942
1068
 
943
- 127
944
- 128
945
- 129</pre>
1069
+ 167
1070
+ 168
1071
+ 169</pre>
946
1072
  </td>
947
1073
  <td>
948
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 127</span>
1074
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 167</span>
949
1075
 
950
- <span class='kw'>def</span> <span class='id identifier rubyid_decipher_only?'>decipher_only?</span>
951
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_DECIPHER_ONLY</span> <span class='rparen'>)</span>
1076
+ <span class='kw'>def</span> <span class='id identifier rubyid_digital_signature?'>digital_signature?</span>
1077
+ <span class='lparen'>(</span><span class='ivar'>@digital_signature</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
952
1078
  <span class='kw'>end</span></pre>
953
1079
  </td>
954
1080
  </tr>
@@ -956,9 +1082,9 @@ access to the components and meaning of the extension's contents.</p>
956
1082
  </div>
957
1083
 
958
1084
  <div class="method_details ">
959
- <h3 class="signature " id="digital_signature?-instance_method">
1085
+ <h3 class="signature " id="encipher_only?-instance_method">
960
1086
 
961
- - (<tt>Boolean</tt>) <strong>digital_signature?</strong>
1087
+ - (<tt>Boolean</tt>) <strong>encipher_only?</strong>
962
1088
 
963
1089
 
964
1090
 
@@ -992,15 +1118,15 @@ access to the components and meaning of the extension's contents.</p>
992
1118
  <pre class="lines">
993
1119
 
994
1120
 
995
- 95
996
- 96
997
- 97</pre>
1121
+ 195
1122
+ 196
1123
+ 197</pre>
998
1124
  </td>
999
1125
  <td>
1000
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 95</span>
1126
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 195</span>
1001
1127
 
1002
- <span class='kw'>def</span> <span class='id identifier rubyid_digital_signature?'>digital_signature?</span>
1003
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_DIGITAL_SIGNATURE</span> <span class='rparen'>)</span>
1128
+ <span class='kw'>def</span> <span class='id identifier rubyid_encipher_only?'>encipher_only?</span>
1129
+ <span class='lparen'>(</span><span class='ivar'>@encipher_only</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
1004
1130
  <span class='kw'>end</span></pre>
1005
1131
  </td>
1006
1132
  </tr>
@@ -1008,9 +1134,9 @@ access to the components and meaning of the extension's contents.</p>
1008
1134
  </div>
1009
1135
 
1010
1136
  <div class="method_details ">
1011
- <h3 class="signature " id="encipher_only?-instance_method">
1137
+ <h3 class="signature " id="key_agreement?-instance_method">
1012
1138
 
1013
- - (<tt>Boolean</tt>) <strong>encipher_only?</strong>
1139
+ - (<tt>Boolean</tt>) <strong>key_agreement?</strong>
1014
1140
 
1015
1141
 
1016
1142
 
@@ -1044,15 +1170,15 @@ access to the components and meaning of the extension's contents.</p>
1044
1170
  <pre class="lines">
1045
1171
 
1046
1172
 
1047
- 123
1048
- 124
1049
- 125</pre>
1173
+ 183
1174
+ 184
1175
+ 185</pre>
1050
1176
  </td>
1051
1177
  <td>
1052
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 123</span>
1178
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 183</span>
1053
1179
 
1054
- <span class='kw'>def</span> <span class='id identifier rubyid_encipher_only?'>encipher_only?</span>
1055
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_ENCIPHER_ONLY</span> <span class='rparen'>)</span>
1180
+ <span class='kw'>def</span> <span class='id identifier rubyid_key_agreement?'>key_agreement?</span>
1181
+ <span class='lparen'>(</span><span class='ivar'>@key_agreement</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
1056
1182
  <span class='kw'>end</span></pre>
1057
1183
  </td>
1058
1184
  </tr>
@@ -1060,9 +1186,9 @@ access to the components and meaning of the extension's contents.</p>
1060
1186
  </div>
1061
1187
 
1062
1188
  <div class="method_details ">
1063
- <h3 class="signature " id="key_agreement?-instance_method">
1189
+ <h3 class="signature " id="key_cert_sign?-instance_method">
1064
1190
 
1065
- - (<tt>Boolean</tt>) <strong>key_agreement?</strong>
1191
+ - (<tt>Boolean</tt>) <strong>key_cert_sign?</strong>
1066
1192
 
1067
1193
 
1068
1194
 
@@ -1096,15 +1222,15 @@ access to the components and meaning of the extension's contents.</p>
1096
1222
  <pre class="lines">
1097
1223
 
1098
1224
 
1099
- 111
1100
- 112
1101
- 113</pre>
1225
+ 187
1226
+ 188
1227
+ 189</pre>
1102
1228
  </td>
1103
1229
  <td>
1104
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 111</span>
1230
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 187</span>
1105
1231
 
1106
- <span class='kw'>def</span> <span class='id identifier rubyid_key_agreement?'>key_agreement?</span>
1107
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_KEY_AGREEMENT</span> <span class='rparen'>)</span>
1232
+ <span class='kw'>def</span> <span class='id identifier rubyid_key_cert_sign?'>key_cert_sign?</span>
1233
+ <span class='lparen'>(</span><span class='ivar'>@key_cert_sign</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
1108
1234
  <span class='kw'>end</span></pre>
1109
1235
  </td>
1110
1236
  </tr>
@@ -1148,15 +1274,15 @@ access to the components and meaning of the extension's contents.</p>
1148
1274
  <pre class="lines">
1149
1275
 
1150
1276
 
1151
- 103
1152
- 104
1153
- 105</pre>
1277
+ 175
1278
+ 176
1279
+ 177</pre>
1154
1280
  </td>
1155
1281
  <td>
1156
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 103</span>
1282
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 175</span>
1157
1283
 
1158
1284
  <span class='kw'>def</span> <span class='id identifier rubyid_key_encipherment?'>key_encipherment?</span>
1159
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_KEY_ENCIPHERMENT</span> <span class='rparen'>)</span>
1285
+ <span class='lparen'>(</span><span class='ivar'>@key_encipherment</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
1160
1286
  <span class='kw'>end</span></pre>
1161
1287
  </td>
1162
1288
  </tr>
@@ -1200,15 +1326,15 @@ access to the components and meaning of the extension's contents.</p>
1200
1326
  <pre class="lines">
1201
1327
 
1202
1328
 
1203
- 99
1204
- 100
1205
- 101</pre>
1329
+ 171
1330
+ 172
1331
+ 173</pre>
1206
1332
  </td>
1207
1333
  <td>
1208
- <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 99</span>
1334
+ <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 171</span>
1209
1335
 
1210
1336
  <span class='kw'>def</span> <span class='id identifier rubyid_non_repudiation?'>non_repudiation?</span>
1211
- <span class='id identifier rubyid_allows?'>allows?</span><span class='lparen'>(</span> <span class='const'>AU_NON_REPUDIATION</span> <span class='rparen'>)</span>
1337
+ <span class='lparen'>(</span><span class='ivar'>@non_repudiation</span> <span class='op'>==</span> <span class='kw'>true</span><span class='rparen'>)</span>
1212
1338
  <span class='kw'>end</span></pre>
1213
1339
  </td>
1214
1340
  </tr>
@@ -1220,9 +1346,9 @@ access to the components and meaning of the extension's contents.</p>
1220
1346
  </div>
1221
1347
 
1222
1348
  <div id="footer">
1223
- Generated on Thu Nov 8 14:19:28 2012 by
1349
+ Generated on Tue Apr 16 10:49:57 2013 by
1224
1350
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1225
- 0.8.2.1 (ruby-1.9.3).
1351
+ 0.8.5 (ruby-1.9.3).
1226
1352
  </div>
1227
1353
 
1228
1354
  </body>