r509 0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. data/README.md +447 -0
  2. data/Rakefile +38 -0
  3. data/bin/r509 +96 -0
  4. data/bin/r509-parse +35 -0
  5. data/doc/R509.html +154 -0
  6. data/doc/R509/Cert.html +3954 -0
  7. data/doc/R509/Cert/Extensions.html +360 -0
  8. data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +391 -0
  9. data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +148 -0
  10. data/doc/R509/Cert/Extensions/BasicConstraints.html +482 -0
  11. data/doc/R509/Cert/Extensions/CrlDistributionPoints.html +316 -0
  12. data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +780 -0
  13. data/doc/R509/Cert/Extensions/KeyUsage.html +1230 -0
  14. data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +467 -0
  15. data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +216 -0
  16. data/doc/R509/CertificateAuthority.html +126 -0
  17. data/doc/R509/CertificateAuthority/Signer.html +855 -0
  18. data/doc/R509/Config.html +127 -0
  19. data/doc/R509/Config/CaConfig.html +2144 -0
  20. data/doc/R509/Config/CaConfigPool.html +599 -0
  21. data/doc/R509/Config/CaProfile.html +656 -0
  22. data/doc/R509/Config/SubjectItemPolicy.html +578 -0
  23. data/doc/R509/Crl.html +126 -0
  24. data/doc/R509/Crl/Administrator.html +2077 -0
  25. data/doc/R509/Crl/Parser.html +1224 -0
  26. data/doc/R509/Csr.html +2248 -0
  27. data/doc/R509/IOHelpers.html +564 -0
  28. data/doc/R509/MessageDigest.html +396 -0
  29. data/doc/R509/NameSanitizer.html +319 -0
  30. data/doc/R509/Ocsp.html +128 -0
  31. data/doc/R509/Ocsp/Request.html +126 -0
  32. data/doc/R509/Ocsp/Request/Nonce.html +160 -0
  33. data/doc/R509/Ocsp/Response.html +837 -0
  34. data/doc/R509/OidMapper.html +393 -0
  35. data/doc/R509/PrivateKey.html +1647 -0
  36. data/doc/R509/R509Error.html +134 -0
  37. data/doc/R509/Spki.html +1424 -0
  38. data/doc/R509/Subject.html +836 -0
  39. data/doc/R509/Validity.html +160 -0
  40. data/doc/R509/Validity/Checker.html +320 -0
  41. data/doc/R509/Validity/DefaultChecker.html +283 -0
  42. data/doc/R509/Validity/DefaultWriter.html +330 -0
  43. data/doc/R509/Validity/Status.html +561 -0
  44. data/doc/R509/Validity/Writer.html +394 -0
  45. data/doc/_index.html +501 -0
  46. data/doc/class_list.html +53 -0
  47. data/doc/css/common.css +1 -0
  48. data/doc/css/full_list.css +57 -0
  49. data/doc/css/style.css +328 -0
  50. data/doc/file.README.html +534 -0
  51. data/doc/file.r509.html +149 -0
  52. data/doc/file_list.html +58 -0
  53. data/doc/frames.html +28 -0
  54. data/doc/index.html +534 -0
  55. data/doc/js/app.js +208 -0
  56. data/doc/js/full_list.js +173 -0
  57. data/doc/js/jquery.js +4 -0
  58. data/doc/methods_list.html +1932 -0
  59. data/doc/top-level-namespace.html +112 -0
  60. data/lib/r509.rb +22 -0
  61. data/lib/r509/cert.rb +414 -0
  62. data/lib/r509/cert/extensions.rb +309 -0
  63. data/lib/r509/certificateauthority.rb +290 -0
  64. data/lib/r509/config.rb +407 -0
  65. data/lib/r509/crl.rb +379 -0
  66. data/lib/r509/csr.rb +324 -0
  67. data/lib/r509/exceptions.rb +5 -0
  68. data/lib/r509/io_helpers.rb +52 -0
  69. data/lib/r509/messagedigest.rb +49 -0
  70. data/lib/r509/ocsp.rb +85 -0
  71. data/lib/r509/oidmapper.rb +32 -0
  72. data/lib/r509/privatekey.rb +185 -0
  73. data/lib/r509/spki.rb +112 -0
  74. data/lib/r509/subject.rb +133 -0
  75. data/lib/r509/validity.rb +92 -0
  76. data/lib/r509/version.rb +4 -0
  77. data/r509.yaml +73 -0
  78. data/spec/cert/extensions_spec.rb +632 -0
  79. data/spec/cert_spec.rb +321 -0
  80. data/spec/certificate_authority_spec.rb +260 -0
  81. data/spec/config_spec.rb +349 -0
  82. data/spec/crl_spec.rb +215 -0
  83. data/spec/csr_spec.rb +302 -0
  84. data/spec/fixtures.rb +233 -0
  85. data/spec/fixtures/cert1.der +0 -0
  86. data/spec/fixtures/cert1.pem +24 -0
  87. data/spec/fixtures/cert1_public_key_modulus.txt +1 -0
  88. data/spec/fixtures/cert3.p12 +0 -0
  89. data/spec/fixtures/cert3.pem +28 -0
  90. data/spec/fixtures/cert3_key.pem +27 -0
  91. data/spec/fixtures/cert3_key_des3.pem +30 -0
  92. data/spec/fixtures/cert4.pem +14 -0
  93. data/spec/fixtures/cert5.pem +30 -0
  94. data/spec/fixtures/cert6.pem +26 -0
  95. data/spec/fixtures/cert_expired.pem +26 -0
  96. data/spec/fixtures/cert_not_yet_valid.pem +26 -0
  97. data/spec/fixtures/cert_san.pem +27 -0
  98. data/spec/fixtures/cert_san2.pem +22 -0
  99. data/spec/fixtures/config_pool_test_minimal.yaml +15 -0
  100. data/spec/fixtures/config_test.yaml +41 -0
  101. data/spec/fixtures/config_test_engine_key.yaml +7 -0
  102. data/spec/fixtures/config_test_engine_no_key_name.yaml +6 -0
  103. data/spec/fixtures/config_test_minimal.yaml +7 -0
  104. data/spec/fixtures/config_test_password.yaml +7 -0
  105. data/spec/fixtures/config_test_various.yaml +100 -0
  106. data/spec/fixtures/crl_list_file.txt +1 -0
  107. data/spec/fixtures/crl_with_reason.pem +17 -0
  108. data/spec/fixtures/csr1.der +0 -0
  109. data/spec/fixtures/csr1.pem +17 -0
  110. data/spec/fixtures/csr1_key.der +0 -0
  111. data/spec/fixtures/csr1_key.pem +27 -0
  112. data/spec/fixtures/csr1_key_encrypted_des3.pem +30 -0
  113. data/spec/fixtures/csr1_newlines.pem +32 -0
  114. data/spec/fixtures/csr1_no_begin_end.pem +15 -0
  115. data/spec/fixtures/csr1_public_key_modulus.txt +1 -0
  116. data/spec/fixtures/csr2.pem +15 -0
  117. data/spec/fixtures/csr2_key.pem +27 -0
  118. data/spec/fixtures/csr3.pem +16 -0
  119. data/spec/fixtures/csr4.pem +25 -0
  120. data/spec/fixtures/csr_dsa.pem +15 -0
  121. data/spec/fixtures/csr_invalid_signature.pem +13 -0
  122. data/spec/fixtures/dsa_key.pem +20 -0
  123. data/spec/fixtures/key4.pem +27 -0
  124. data/spec/fixtures/key4_encrypted_des3.pem +30 -0
  125. data/spec/fixtures/missing_key_identifier_ca.cer +21 -0
  126. data/spec/fixtures/missing_key_identifier_ca.key +27 -0
  127. data/spec/fixtures/ocsptest.r509.local.pem +27 -0
  128. data/spec/fixtures/ocsptest.r509.local_ocsp_request.der +0 -0
  129. data/spec/fixtures/ocsptest2.r509.local.pem +27 -0
  130. data/spec/fixtures/second_ca.cer +26 -0
  131. data/spec/fixtures/second_ca.key +27 -0
  132. data/spec/fixtures/spkac.der +0 -0
  133. data/spec/fixtures/spkac.txt +1 -0
  134. data/spec/fixtures/spkac_dsa.txt +1 -0
  135. data/spec/fixtures/stca.pem +22 -0
  136. data/spec/fixtures/stca_ocsp_request.der +0 -0
  137. data/spec/fixtures/stca_ocsp_response.der +0 -0
  138. data/spec/fixtures/test1.csr +17 -0
  139. data/spec/fixtures/test_ca.cer +22 -0
  140. data/spec/fixtures/test_ca.key +28 -0
  141. data/spec/fixtures/test_ca.p12 +0 -0
  142. data/spec/fixtures/test_ca_des3.key +30 -0
  143. data/spec/fixtures/test_ca_ocsp.cer +26 -0
  144. data/spec/fixtures/test_ca_ocsp.key +27 -0
  145. data/spec/fixtures/test_ca_ocsp.p12 +0 -0
  146. data/spec/fixtures/test_ca_ocsp_chain.txt +48 -0
  147. data/spec/fixtures/test_ca_ocsp_response.der +0 -0
  148. data/spec/fixtures/test_ca_subroot.cer +26 -0
  149. data/spec/fixtures/test_ca_subroot.key +27 -0
  150. data/spec/fixtures/test_ca_subroot_ocsp.cer +25 -0
  151. data/spec/fixtures/test_ca_subroot_ocsp.key +27 -0
  152. data/spec/fixtures/test_ca_subroot_ocsp_response.der +0 -0
  153. data/spec/fixtures/unknown_oid.csr +17 -0
  154. data/spec/message_digest_spec.rb +89 -0
  155. data/spec/ocsp_spec.rb +111 -0
  156. data/spec/oid_mapper_spec.rb +31 -0
  157. data/spec/privatekey_spec.rb +198 -0
  158. data/spec/spec_helper.rb +14 -0
  159. data/spec/spki_spec.rb +157 -0
  160. data/spec/subject_spec.rb +203 -0
  161. data/spec/validity_spec.rb +98 -0
  162. metadata +257 -0
@@ -0,0 +1,836 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: R509::Subject
8
+
9
+ &mdash; Documentation by YARD 0.8.0
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (S)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../R509.html" title="R509 (module)">R509</a></span></span>
36
+ &raquo;
37
+ <span class="title">Subject</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: R509::Subject
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName">Object</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">R509::Subject</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+ <dt class="r2 last">Defined in:</dt>
97
+ <dd class="r2 last">lib/r509/subject.rb</dd>
98
+
99
+ </dl>
100
+ <div class="clear"></div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+
105
+ <p>subject class. Used for building OpenSSL::X509::Name objects in a sane
106
+ fashion</p>
107
+
108
+
109
+ </div>
110
+ </div>
111
+ <div class="tags">
112
+
113
+
114
+ </div>
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ <h2>
123
+ Instance Method Summary
124
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
125
+ </h2>
126
+
127
+ <ul class="summary">
128
+
129
+ <li class="public ">
130
+ <span class="summary_signature">
131
+
132
+ <a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Object) <strong>[]</strong>(key) </a>
133
+
134
+
135
+
136
+ </span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>get value for key.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ <li class="public ">
154
+ <span class="summary_signature">
155
+
156
+ <a href="#%5B%5D%3D-instance_method" title="#[]= (instance method)">- (Object) <strong>[]=</strong>(key, value) </a>
157
+
158
+
159
+
160
+ </span>
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+ <span class="summary_desc"><div class='inline'>
171
+ <p>set key and value.</p>
172
+ </div></span>
173
+
174
+ </li>
175
+
176
+
177
+ <li class="public ">
178
+ <span class="summary_signature">
179
+
180
+ <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(key) </a>
181
+
182
+
183
+
184
+ </span>
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+ <span class="summary_desc"><div class='inline'></div></span>
195
+
196
+ </li>
197
+
198
+
199
+ <li class="public ">
200
+ <span class="summary_signature">
201
+
202
+ <a href="#empty%3F-instance_method" title="#empty? (instance method)">- (Boolean) <strong>empty?</strong> </a>
203
+
204
+
205
+
206
+ </span>
207
+
208
+
209
+
210
+
211
+
212
+
213
+
214
+
215
+
216
+ <span class="summary_desc"><div class='inline'></div></span>
217
+
218
+ </li>
219
+
220
+
221
+ <li class="public ">
222
+ <span class="summary_signature">
223
+
224
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Subject) <strong>initialize</strong>(arg = nil) </a>
225
+
226
+
227
+
228
+ </span>
229
+
230
+
231
+ <span class="note title constructor">constructor</span>
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+ <span class="summary_desc"><div class='inline'>
241
+ <p>A new instance of Subject.</p>
242
+ </div></span>
243
+
244
+ </li>
245
+
246
+
247
+ <li class="public ">
248
+ <span class="summary_signature">
249
+
250
+ <a href="#name-instance_method" title="#name (instance method)">- (OpenSSL::X509::Name) <strong>name</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
+
266
+ </li>
267
+
268
+
269
+ <li class="public ">
270
+ <span class="summary_signature">
271
+
272
+ <a href="#to_a-instance_method" title="#to_a (instance method)">- (Array) <strong>to_a</strong> </a>
273
+
274
+
275
+
276
+ </span>
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+ <span class="summary_desc"><div class='inline'>
287
+ <p>Array of form [['<a href="http://'O','Org'">CN','langui.sh'],</a>].</p>
288
+ </div></span>
289
+
290
+ </li>
291
+
292
+
293
+ <li class="public ">
294
+ <span class="summary_signature">
295
+
296
+ <a href="#to_s-instance_method" title="#to_s (instance method)">- (String) <strong>to_s</strong> </a>
297
+
298
+
299
+
300
+ </span>
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+ <span class="summary_desc"><div class='inline'>
311
+ <p>String of form /CN=something.com/O=whatever/L=Locality.</p>
312
+ </div></span>
313
+
314
+ </li>
315
+
316
+
317
+ </ul>
318
+
319
+
320
+ <div id="constructor_details" class="method_details_list">
321
+ <h2>Constructor Details</h2>
322
+
323
+ <div class="method_details first">
324
+ <h3 class="signature first" id="initialize-instance_method">
325
+
326
+ - (<tt><span class='object_link'><a href="" title="R509::Subject (class)">Subject</a></span></tt>) <strong>initialize</strong>(arg = nil)
327
+
328
+
329
+
330
+
331
+
332
+ </h3><div class="docstring">
333
+ <div class="discussion">
334
+
335
+ <p>A new instance of Subject</p>
336
+
337
+
338
+ </div>
339
+ </div>
340
+ <div class="tags">
341
+ <p class="tag_title">Parameters:</p>
342
+ <ul class="param">
343
+
344
+ <li>
345
+
346
+ <span class='name'>arg</span>
347
+
348
+
349
+ <span class='type'>(<tt>Array</tt>, <tt>OpenSSL::X509::Name</tt>, <tt><span class='object_link'><a href="" title="R509::Subject (class)">R509::Subject</a></span></tt>)</span>
350
+
351
+
352
+ <em class="default">(defaults to: <tt>nil</tt>)</em>
353
+
354
+
355
+ </li>
356
+
357
+ </ul>
358
+
359
+
360
+ </div><table class="source_code">
361
+ <tr>
362
+ <td>
363
+ <pre class="lines">
364
+
365
+
366
+ 7
367
+ 8
368
+ 9
369
+ 10
370
+ 11
371
+ 12
372
+ 13
373
+ 14
374
+ 15
375
+ 16
376
+ 17
377
+ 18
378
+ 19
379
+ 20
380
+ 21
381
+ 22</pre>
382
+ </td>
383
+ <td>
384
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 7</span>
385
+
386
+ <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='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
387
+ <span class='kw'>case</span> <span class='id identifier rubyid_arg'>arg</span>
388
+ <span class='kw'>when</span> <span class='const'>Array</span>
389
+ <span class='ivar'>@array</span> <span class='op'>=</span> <span class='id identifier rubyid_arg'>arg</span>
390
+ <span class='kw'>when</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>X509</span><span class='op'>::</span><span class='const'>Name</span>
391
+ <span class='id identifier rubyid_sanitizer'>sanitizer</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>NameSanitizer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
392
+ <span class='ivar'>@array</span> <span class='op'>=</span> <span class='id identifier rubyid_sanitizer'>sanitizer</span><span class='period'>.</span><span class='id identifier rubyid_sanitize'>sanitize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span>
393
+ <span class='kw'>when</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Subject</span>
394
+ <span class='ivar'>@array</span> <span class='op'>=</span> <span class='id identifier rubyid_arg'>arg</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span>
395
+ <span class='kw'>else</span>
396
+ <span class='ivar'>@array</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
397
+ <span class='kw'>end</span>
398
+
399
+ <span class='comment'># see if X509 thinks this is okay
400
+ </span> <span class='id identifier rubyid_name'>name</span>
401
+ <span class='kw'>end</span></pre>
402
+ </td>
403
+ </tr>
404
+ </table>
405
+ </div>
406
+
407
+ </div>
408
+
409
+
410
+ <div id="instance_method_details" class="method_details_list">
411
+ <h2>Instance Method Details</h2>
412
+
413
+
414
+ <div class="method_details first">
415
+ <h3 class="signature first" id="[]-instance_method">
416
+
417
+ - (<tt>Object</tt>) <strong>[]</strong>(key)
418
+
419
+
420
+
421
+
422
+
423
+ </h3><div class="docstring">
424
+ <div class="discussion">
425
+
426
+ <p>get value for key</p>
427
+
428
+
429
+ </div>
430
+ </div>
431
+ <div class="tags">
432
+
433
+
434
+ </div><table class="source_code">
435
+ <tr>
436
+ <td>
437
+ <pre class="lines">
438
+
439
+
440
+ 35
441
+ 36
442
+ 37
443
+ 38
444
+ 39
445
+ 40
446
+ 41
447
+ 42</pre>
448
+ </td>
449
+ <td>
450
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 35</span>
451
+
452
+ <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
453
+ <span class='ivar'>@array</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
454
+ <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
455
+ <span class='kw'>return</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span>
456
+ <span class='kw'>end</span>
457
+ <span class='kw'>end</span>
458
+ <span class='kw'>return</span> <span class='kw'>nil</span>
459
+ <span class='kw'>end</span></pre>
460
+ </td>
461
+ </tr>
462
+ </table>
463
+ </div>
464
+
465
+ <div class="method_details ">
466
+ <h3 class="signature " id="[]=-instance_method">
467
+
468
+ - (<tt>Object</tt>) <strong>[]=</strong>(key, value)
469
+
470
+
471
+
472
+
473
+
474
+ </h3><div class="docstring">
475
+ <div class="discussion">
476
+
477
+ <p>set key and value</p>
478
+
479
+
480
+ </div>
481
+ </div>
482
+ <div class="tags">
483
+
484
+
485
+ </div><table class="source_code">
486
+ <tr>
487
+ <td>
488
+ <pre class="lines">
489
+
490
+
491
+ 45
492
+ 46
493
+ 47
494
+ 48
495
+ 49
496
+ 50
497
+ 51
498
+ 52
499
+ 53
500
+ 54
501
+ 55
502
+ 56
503
+ 57
504
+ 58
505
+ 59
506
+ 60
507
+ 61
508
+ 62
509
+ 63
510
+ 64</pre>
511
+ </td>
512
+ <td>
513
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 45</span>
514
+
515
+ <span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
516
+ <span class='id identifier rubyid_added'>added</span> <span class='op'>=</span> <span class='kw'>false</span>
517
+ <span class='ivar'>@array</span> <span class='op'>=</span> <span class='ivar'>@array</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_item'>item</span><span class='op'>|</span>
518
+ <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span> <span class='op'>==</span> <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
519
+ <span class='id identifier rubyid_added'>added</span> <span class='op'>=</span> <span class='kw'>true</span>
520
+ <span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
521
+ <span class='kw'>else</span>
522
+ <span class='id identifier rubyid_item'>item</span>
523
+ <span class='kw'>end</span>
524
+ <span class='rbrace'>}</span>
525
+
526
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_added'>added</span>
527
+ <span class='ivar'>@array</span> <span class='op'>&lt;&lt;</span> <span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
528
+ <span class='kw'>end</span>
529
+
530
+ <span class='comment'># see if X509 thinks this is okay
531
+ </span> <span class='id identifier rubyid_name'>name</span>
532
+
533
+ <span class='ivar'>@array</span>
534
+ <span class='kw'>end</span></pre>
535
+ </td>
536
+ </tr>
537
+ </table>
538
+ </div>
539
+
540
+ <div class="method_details ">
541
+ <h3 class="signature " id="delete-instance_method">
542
+
543
+ - (<tt>Object</tt>) <strong>delete</strong>(key)
544
+
545
+
546
+
547
+
548
+
549
+ </h3><div class="docstring">
550
+ <div class="discussion">
551
+
552
+
553
+ </div>
554
+ </div>
555
+ <div class="tags">
556
+ <p class="tag_title">Parameters:</p>
557
+ <ul class="param">
558
+
559
+ <li>
560
+
561
+ <span class='name'>key</span>
562
+
563
+
564
+ <span class='type'>(<tt>String</tt>)</span>
565
+
566
+
567
+
568
+ &mdash;
569
+ <div class='inline'>
570
+ <p>item you want deleted</p>
571
+ </div>
572
+
573
+ </li>
574
+
575
+ </ul>
576
+
577
+
578
+ </div><table class="source_code">
579
+ <tr>
580
+ <td>
581
+ <pre class="lines">
582
+
583
+
584
+ 67
585
+ 68
586
+ 69
587
+ 70
588
+ 71</pre>
589
+ </td>
590
+ <td>
591
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 67</span>
592
+
593
+ <span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
594
+ <span class='ivar'>@array</span> <span class='op'>=</span> <span class='ivar'>@array</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
595
+ <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='id identifier rubyid_key'>key</span>
596
+ <span class='kw'>end</span>
597
+ <span class='kw'>end</span></pre>
598
+ </td>
599
+ </tr>
600
+ </table>
601
+ </div>
602
+
603
+ <div class="method_details ">
604
+ <h3 class="signature " id="empty?-instance_method">
605
+
606
+ - (<tt>Boolean</tt>) <strong>empty?</strong>
607
+
608
+
609
+
610
+
611
+
612
+ </h3><div class="docstring">
613
+ <div class="discussion">
614
+
615
+
616
+ </div>
617
+ </div>
618
+ <div class="tags">
619
+
620
+ <p class="tag_title">Returns:</p>
621
+ <ul class="return">
622
+
623
+ <li>
624
+
625
+
626
+ <span class='type'>(<tt>Boolean</tt>)</span>
627
+
628
+
629
+
630
+ </li>
631
+
632
+ </ul>
633
+
634
+ </div><table class="source_code">
635
+ <tr>
636
+ <td>
637
+ <pre class="lines">
638
+
639
+
640
+ 30
641
+ 31
642
+ 32</pre>
643
+ </td>
644
+ <td>
645
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 30</span>
646
+
647
+ <span class='kw'>def</span> <span class='id identifier rubyid_empty?'>empty?</span>
648
+ <span class='ivar'>@array</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
649
+ <span class='kw'>end</span></pre>
650
+ </td>
651
+ </tr>
652
+ </table>
653
+ </div>
654
+
655
+ <div class="method_details ">
656
+ <h3 class="signature " id="name-instance_method">
657
+
658
+ - (<tt>OpenSSL::X509::Name</tt>) <strong>name</strong>
659
+
660
+
661
+
662
+
663
+
664
+ </h3><div class="docstring">
665
+ <div class="discussion">
666
+
667
+
668
+ </div>
669
+ </div>
670
+ <div class="tags">
671
+
672
+ <p class="tag_title">Returns:</p>
673
+ <ul class="return">
674
+
675
+ <li>
676
+
677
+
678
+ <span class='type'>(<tt>OpenSSL::X509::Name</tt>)</span>
679
+
680
+
681
+
682
+ </li>
683
+
684
+ </ul>
685
+
686
+ </div><table class="source_code">
687
+ <tr>
688
+ <td>
689
+ <pre class="lines">
690
+
691
+
692
+ 25
693
+ 26
694
+ 27</pre>
695
+ </td>
696
+ <td>
697
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 25</span>
698
+
699
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
700
+ <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>X509</span><span class='op'>::</span><span class='const'>Name</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@array</span><span class='rparen'>)</span>
701
+ <span class='kw'>end</span></pre>
702
+ </td>
703
+ </tr>
704
+ </table>
705
+ </div>
706
+
707
+ <div class="method_details ">
708
+ <h3 class="signature " id="to_a-instance_method">
709
+
710
+ - (<tt>Array</tt>) <strong>to_a</strong>
711
+
712
+
713
+
714
+
715
+
716
+ </h3><div class="docstring">
717
+ <div class="discussion">
718
+
719
+ <p>Array of form [['<a href="http://'O','Org'">CN','langui.sh'],</a>]</p>
720
+
721
+
722
+ </div>
723
+ </div>
724
+ <div class="tags">
725
+
726
+ <p class="tag_title">Returns:</p>
727
+ <ul class="return">
728
+
729
+ <li>
730
+
731
+
732
+ <span class='type'>(<tt>Array</tt>)</span>
733
+
734
+
735
+
736
+ &mdash;
737
+ <div class='inline'>
738
+ <p>Array of form [['<a href="http://'O','Org'">CN','langui.sh'],</a>]</p>
739
+ </div>
740
+
741
+ </li>
742
+
743
+ </ul>
744
+
745
+ </div><table class="source_code">
746
+ <tr>
747
+ <td>
748
+ <pre class="lines">
749
+
750
+
751
+ 79
752
+ 80
753
+ 81</pre>
754
+ </td>
755
+ <td>
756
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 79</span>
757
+
758
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
759
+ <span class='ivar'>@array</span>
760
+ <span class='kw'>end</span></pre>
761
+ </td>
762
+ </tr>
763
+ </table>
764
+ </div>
765
+
766
+ <div class="method_details ">
767
+ <h3 class="signature " id="to_s-instance_method">
768
+
769
+ - (<tt>String</tt>) <strong>to_s</strong>
770
+
771
+
772
+
773
+
774
+
775
+ </h3><div class="docstring">
776
+ <div class="discussion">
777
+
778
+ <p>String of form /CN=something.com/O=whatever/L=Locality</p>
779
+
780
+
781
+ </div>
782
+ </div>
783
+ <div class="tags">
784
+
785
+ <p class="tag_title">Returns:</p>
786
+ <ul class="return">
787
+
788
+ <li>
789
+
790
+
791
+ <span class='type'>(<tt>String</tt>)</span>
792
+
793
+
794
+
795
+ &mdash;
796
+ <div class='inline'>
797
+ <p>string of form /CN=something.com/O=whatever/L=Locality</p>
798
+ </div>
799
+
800
+ </li>
801
+
802
+ </ul>
803
+
804
+ </div><table class="source_code">
805
+ <tr>
806
+ <td>
807
+ <pre class="lines">
808
+
809
+
810
+ 74
811
+ 75
812
+ 76</pre>
813
+ </td>
814
+ <td>
815
+ <pre class="code"><span class="info file"># File 'lib/r509/subject.rb', line 74</span>
816
+
817
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_s'>to_s</span>
818
+ <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
819
+ <span class='kw'>end</span></pre>
820
+ </td>
821
+ </tr>
822
+ </table>
823
+ </div>
824
+
825
+ </div>
826
+
827
+ </div>
828
+
829
+ <div id="footer">
830
+ Generated on Tue Oct 23 22:48:02 2012 by
831
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
832
+ 0.8.0 (ruby-1.9.3).
833
+ </div>
834
+
835
+ </body>
836
+ </html>