r509 0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/README.md +447 -0
  2. data/Rakefile +38 -0
  3. data/bin/r509 +96 -0
  4. data/bin/r509-parse +35 -0
  5. data/doc/R509.html +154 -0
  6. data/doc/R509/Cert.html +3954 -0
  7. data/doc/R509/Cert/Extensions.html +360 -0
  8. data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +391 -0
  9. data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +148 -0
  10. data/doc/R509/Cert/Extensions/BasicConstraints.html +482 -0
  11. data/doc/R509/Cert/Extensions/CrlDistributionPoints.html +316 -0
  12. data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +780 -0
  13. data/doc/R509/Cert/Extensions/KeyUsage.html +1230 -0
  14. data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +467 -0
  15. data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +216 -0
  16. data/doc/R509/CertificateAuthority.html +126 -0
  17. data/doc/R509/CertificateAuthority/Signer.html +855 -0
  18. data/doc/R509/Config.html +127 -0
  19. data/doc/R509/Config/CaConfig.html +2144 -0
  20. data/doc/R509/Config/CaConfigPool.html +599 -0
  21. data/doc/R509/Config/CaProfile.html +656 -0
  22. data/doc/R509/Config/SubjectItemPolicy.html +578 -0
  23. data/doc/R509/Crl.html +126 -0
  24. data/doc/R509/Crl/Administrator.html +2077 -0
  25. data/doc/R509/Crl/Parser.html +1224 -0
  26. data/doc/R509/Csr.html +2248 -0
  27. data/doc/R509/IOHelpers.html +564 -0
  28. data/doc/R509/MessageDigest.html +396 -0
  29. data/doc/R509/NameSanitizer.html +319 -0
  30. data/doc/R509/Ocsp.html +128 -0
  31. data/doc/R509/Ocsp/Request.html +126 -0
  32. data/doc/R509/Ocsp/Request/Nonce.html +160 -0
  33. data/doc/R509/Ocsp/Response.html +837 -0
  34. data/doc/R509/OidMapper.html +393 -0
  35. data/doc/R509/PrivateKey.html +1647 -0
  36. data/doc/R509/R509Error.html +134 -0
  37. data/doc/R509/Spki.html +1424 -0
  38. data/doc/R509/Subject.html +836 -0
  39. data/doc/R509/Validity.html +160 -0
  40. data/doc/R509/Validity/Checker.html +320 -0
  41. data/doc/R509/Validity/DefaultChecker.html +283 -0
  42. data/doc/R509/Validity/DefaultWriter.html +330 -0
  43. data/doc/R509/Validity/Status.html +561 -0
  44. data/doc/R509/Validity/Writer.html +394 -0
  45. data/doc/_index.html +501 -0
  46. data/doc/class_list.html +53 -0
  47. data/doc/css/common.css +1 -0
  48. data/doc/css/full_list.css +57 -0
  49. data/doc/css/style.css +328 -0
  50. data/doc/file.README.html +534 -0
  51. data/doc/file.r509.html +149 -0
  52. data/doc/file_list.html +58 -0
  53. data/doc/frames.html +28 -0
  54. data/doc/index.html +534 -0
  55. data/doc/js/app.js +208 -0
  56. data/doc/js/full_list.js +173 -0
  57. data/doc/js/jquery.js +4 -0
  58. data/doc/methods_list.html +1932 -0
  59. data/doc/top-level-namespace.html +112 -0
  60. data/lib/r509.rb +22 -0
  61. data/lib/r509/cert.rb +414 -0
  62. data/lib/r509/cert/extensions.rb +309 -0
  63. data/lib/r509/certificateauthority.rb +290 -0
  64. data/lib/r509/config.rb +407 -0
  65. data/lib/r509/crl.rb +379 -0
  66. data/lib/r509/csr.rb +324 -0
  67. data/lib/r509/exceptions.rb +5 -0
  68. data/lib/r509/io_helpers.rb +52 -0
  69. data/lib/r509/messagedigest.rb +49 -0
  70. data/lib/r509/ocsp.rb +85 -0
  71. data/lib/r509/oidmapper.rb +32 -0
  72. data/lib/r509/privatekey.rb +185 -0
  73. data/lib/r509/spki.rb +112 -0
  74. data/lib/r509/subject.rb +133 -0
  75. data/lib/r509/validity.rb +92 -0
  76. data/lib/r509/version.rb +4 -0
  77. data/r509.yaml +73 -0
  78. data/spec/cert/extensions_spec.rb +632 -0
  79. data/spec/cert_spec.rb +321 -0
  80. data/spec/certificate_authority_spec.rb +260 -0
  81. data/spec/config_spec.rb +349 -0
  82. data/spec/crl_spec.rb +215 -0
  83. data/spec/csr_spec.rb +302 -0
  84. data/spec/fixtures.rb +233 -0
  85. data/spec/fixtures/cert1.der +0 -0
  86. data/spec/fixtures/cert1.pem +24 -0
  87. data/spec/fixtures/cert1_public_key_modulus.txt +1 -0
  88. data/spec/fixtures/cert3.p12 +0 -0
  89. data/spec/fixtures/cert3.pem +28 -0
  90. data/spec/fixtures/cert3_key.pem +27 -0
  91. data/spec/fixtures/cert3_key_des3.pem +30 -0
  92. data/spec/fixtures/cert4.pem +14 -0
  93. data/spec/fixtures/cert5.pem +30 -0
  94. data/spec/fixtures/cert6.pem +26 -0
  95. data/spec/fixtures/cert_expired.pem +26 -0
  96. data/spec/fixtures/cert_not_yet_valid.pem +26 -0
  97. data/spec/fixtures/cert_san.pem +27 -0
  98. data/spec/fixtures/cert_san2.pem +22 -0
  99. data/spec/fixtures/config_pool_test_minimal.yaml +15 -0
  100. data/spec/fixtures/config_test.yaml +41 -0
  101. data/spec/fixtures/config_test_engine_key.yaml +7 -0
  102. data/spec/fixtures/config_test_engine_no_key_name.yaml +6 -0
  103. data/spec/fixtures/config_test_minimal.yaml +7 -0
  104. data/spec/fixtures/config_test_password.yaml +7 -0
  105. data/spec/fixtures/config_test_various.yaml +100 -0
  106. data/spec/fixtures/crl_list_file.txt +1 -0
  107. data/spec/fixtures/crl_with_reason.pem +17 -0
  108. data/spec/fixtures/csr1.der +0 -0
  109. data/spec/fixtures/csr1.pem +17 -0
  110. data/spec/fixtures/csr1_key.der +0 -0
  111. data/spec/fixtures/csr1_key.pem +27 -0
  112. data/spec/fixtures/csr1_key_encrypted_des3.pem +30 -0
  113. data/spec/fixtures/csr1_newlines.pem +32 -0
  114. data/spec/fixtures/csr1_no_begin_end.pem +15 -0
  115. data/spec/fixtures/csr1_public_key_modulus.txt +1 -0
  116. data/spec/fixtures/csr2.pem +15 -0
  117. data/spec/fixtures/csr2_key.pem +27 -0
  118. data/spec/fixtures/csr3.pem +16 -0
  119. data/spec/fixtures/csr4.pem +25 -0
  120. data/spec/fixtures/csr_dsa.pem +15 -0
  121. data/spec/fixtures/csr_invalid_signature.pem +13 -0
  122. data/spec/fixtures/dsa_key.pem +20 -0
  123. data/spec/fixtures/key4.pem +27 -0
  124. data/spec/fixtures/key4_encrypted_des3.pem +30 -0
  125. data/spec/fixtures/missing_key_identifier_ca.cer +21 -0
  126. data/spec/fixtures/missing_key_identifier_ca.key +27 -0
  127. data/spec/fixtures/ocsptest.r509.local.pem +27 -0
  128. data/spec/fixtures/ocsptest.r509.local_ocsp_request.der +0 -0
  129. data/spec/fixtures/ocsptest2.r509.local.pem +27 -0
  130. data/spec/fixtures/second_ca.cer +26 -0
  131. data/spec/fixtures/second_ca.key +27 -0
  132. data/spec/fixtures/spkac.der +0 -0
  133. data/spec/fixtures/spkac.txt +1 -0
  134. data/spec/fixtures/spkac_dsa.txt +1 -0
  135. data/spec/fixtures/stca.pem +22 -0
  136. data/spec/fixtures/stca_ocsp_request.der +0 -0
  137. data/spec/fixtures/stca_ocsp_response.der +0 -0
  138. data/spec/fixtures/test1.csr +17 -0
  139. data/spec/fixtures/test_ca.cer +22 -0
  140. data/spec/fixtures/test_ca.key +28 -0
  141. data/spec/fixtures/test_ca.p12 +0 -0
  142. data/spec/fixtures/test_ca_des3.key +30 -0
  143. data/spec/fixtures/test_ca_ocsp.cer +26 -0
  144. data/spec/fixtures/test_ca_ocsp.key +27 -0
  145. data/spec/fixtures/test_ca_ocsp.p12 +0 -0
  146. data/spec/fixtures/test_ca_ocsp_chain.txt +48 -0
  147. data/spec/fixtures/test_ca_ocsp_response.der +0 -0
  148. data/spec/fixtures/test_ca_subroot.cer +26 -0
  149. data/spec/fixtures/test_ca_subroot.key +27 -0
  150. data/spec/fixtures/test_ca_subroot_ocsp.cer +25 -0
  151. data/spec/fixtures/test_ca_subroot_ocsp.key +27 -0
  152. data/spec/fixtures/test_ca_subroot_ocsp_response.der +0 -0
  153. data/spec/fixtures/unknown_oid.csr +17 -0
  154. data/spec/message_digest_spec.rb +89 -0
  155. data/spec/ocsp_spec.rb +111 -0
  156. data/spec/oid_mapper_spec.rb +31 -0
  157. data/spec/privatekey_spec.rb +198 -0
  158. data/spec/spec_helper.rb +14 -0
  159. data/spec/spki_spec.rb +157 -0
  160. data/spec/subject_spec.rb +203 -0
  161. data/spec/validity_spec.rb +98 -0
  162. metadata +257 -0
@@ -0,0 +1,578 @@
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::Config::SubjectItemPolicy
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> &raquo; <span class='title'><span class='object_link'><a href="../Config.html" title="R509::Config (module)">Config</a></span></span>
36
+ &raquo;
37
+ <span class="title">SubjectItemPolicy</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::Config::SubjectItemPolicy
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::Config::SubjectItemPolicy</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/config.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>returns information about the subject item policy for a profile</p>
106
+
107
+
108
+ </div>
109
+ </div>
110
+ <div class="tags">
111
+
112
+
113
+ </div>
114
+
115
+
116
+
117
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
118
+ <ul class="summary">
119
+
120
+ <li class="public ">
121
+ <span class="summary_signature">
122
+
123
+ <a href="#optional-instance_method" title="#optional (instance method)">- (Object) <strong>optional</strong> </a>
124
+
125
+
126
+
127
+ </span>
128
+
129
+
130
+
131
+
132
+ <span class="note title readonly">readonly</span>
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'>
143
+ <p>Returns the value of attribute optional.</p>
144
+ </div></span>
145
+
146
+ </li>
147
+
148
+
149
+ <li class="public ">
150
+ <span class="summary_signature">
151
+
152
+ <a href="#required-instance_method" title="#required (instance method)">- (Object) <strong>required</strong> </a>
153
+
154
+
155
+
156
+ </span>
157
+
158
+
159
+
160
+
161
+ <span class="note title readonly">readonly</span>
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+ <span class="summary_desc"><div class='inline'>
172
+ <p>Returns the value of attribute required.</p>
173
+ </div></span>
174
+
175
+ </li>
176
+
177
+
178
+ </ul>
179
+
180
+
181
+
182
+
183
+
184
+ <h2>
185
+ Instance Method Summary
186
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
187
+ </h2>
188
+
189
+ <ul class="summary">
190
+
191
+ <li class="public ">
192
+ <span class="summary_signature">
193
+
194
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (SubjectItemPolicy) <strong>initialize</strong>(hash = {}) </a>
195
+
196
+
197
+
198
+ </span>
199
+
200
+
201
+ <span class="note title constructor">constructor</span>
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+
210
+ <span class="summary_desc"><div class='inline'>
211
+ <p>A new instance of SubjectItemPolicy.</p>
212
+ </div></span>
213
+
214
+ </li>
215
+
216
+
217
+ <li class="public ">
218
+ <span class="summary_signature">
219
+
220
+ <a href="#validate_subject-instance_method" title="#validate_subject (instance method)">- (R509::Subject) <strong>validate_subject</strong>(subject) </a>
221
+
222
+
223
+
224
+ </span>
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+ <span class="summary_desc"><div class='inline'>
235
+ <p>Validated version of the subject or error.</p>
236
+ </div></span>
237
+
238
+ </li>
239
+
240
+
241
+ </ul>
242
+
243
+
244
+ <div id="constructor_details" class="method_details_list">
245
+ <h2>Constructor Details</h2>
246
+
247
+ <div class="method_details first">
248
+ <h3 class="signature first" id="initialize-instance_method">
249
+
250
+ - (<tt><span class='object_link'><a href="" title="R509::Config::SubjectItemPolicy (class)">SubjectItemPolicy</a></span></tt>) <strong>initialize</strong>(hash = {})
251
+
252
+
253
+
254
+
255
+
256
+ </h3><div class="docstring">
257
+ <div class="discussion">
258
+
259
+ <p>A new instance of SubjectItemPolicy</p>
260
+
261
+
262
+ </div>
263
+ </div>
264
+ <div class="tags">
265
+
266
+ <div class="examples">
267
+ <p class="tag_title">Examples:</p>
268
+
269
+
270
+ <p class="example_title"><div class='inline'>
271
+ <p>sample hash</p>
272
+ </div></p>
273
+
274
+ <pre class="example code"><span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>CN</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>required</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
275
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>O</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>required</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
276
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>OU</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>optional</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
277
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ST</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>required</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
278
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>C</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>required</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
279
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>L</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>required</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span>
280
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>emailAddress</span><span class='tstring_end'>&quot;</span></span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>optional</span><span class='tstring_end'>&quot;</span></span><span class='rbrace'>}</span></pre>
281
+
282
+ </div>
283
+ <p class="tag_title">Parameters:</p>
284
+ <ul class="param">
285
+
286
+ <li>
287
+
288
+ <span class='name'>hash</span>
289
+
290
+
291
+ <span class='type'>(<tt>Hash</tt>)</span>
292
+
293
+
294
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
295
+
296
+
297
+ &mdash;
298
+ <div class='inline'>
299
+ <p>of required/optional subject items. These must be in OpenSSL shortname
300
+ format.</p>
301
+ </div>
302
+
303
+ </li>
304
+
305
+ </ul>
306
+
307
+
308
+ </div><table class="source_code">
309
+ <tr>
310
+ <td>
311
+ <pre class="lines">
312
+
313
+
314
+ 47
315
+ 48
316
+ 49
317
+ 50
318
+ 51
319
+ 52
320
+ 53
321
+ 54
322
+ 55
323
+ 56
324
+ 57
325
+ 58
326
+ 59
327
+ 60
328
+ 61
329
+ 62
330
+ 63
331
+ 64</pre>
332
+ </td>
333
+ <td>
334
+ <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 47</span>
335
+
336
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_hash'>hash</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
337
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
338
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Must supply a hash in form 'shortname'=&gt;'required/optional'</span><span class='tstring_end'>&quot;</span></span>
339
+ <span class='kw'>end</span>
340
+ <span class='ivar'>@required</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
341
+ <span class='ivar'>@optional</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
342
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
343
+ <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
344
+ <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>required</span><span class='tstring_end'>&quot;</span></span>
345
+ <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
346
+ <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>optional</span><span class='tstring_end'>&quot;</span></span>
347
+ <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
348
+ <span class='kw'>else</span>
349
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unknown subject item policy value. Allowed values are required and optional</span><span class='tstring_end'>&quot;</span></span>
350
+ <span class='kw'>end</span>
351
+ <span class='kw'>end</span>
352
+ <span class='kw'>end</span>
353
+ <span class='kw'>end</span></pre>
354
+ </td>
355
+ </tr>
356
+ </table>
357
+ </div>
358
+
359
+ </div>
360
+
361
+ <div id="instance_attr_details" class="attr_details">
362
+ <h2>Instance Attribute Details</h2>
363
+
364
+
365
+ <span id=""></span>
366
+ <span id="optional-instance_method"></span>
367
+ <div class="method_details first">
368
+ <h3 class="signature first" id="optional-instance_method">
369
+
370
+ - (<tt>Object</tt>) <strong>optional</strong> <span class="extras">(readonly)</span>
371
+
372
+
373
+
374
+
375
+
376
+ </h3><div class="docstring">
377
+ <div class="discussion">
378
+
379
+ <p>Returns the value of attribute optional</p>
380
+
381
+
382
+ </div>
383
+ </div>
384
+ <div class="tags">
385
+
386
+
387
+ </div><table class="source_code">
388
+ <tr>
389
+ <td>
390
+ <pre class="lines">
391
+
392
+
393
+ 36
394
+ 37
395
+ 38</pre>
396
+ </td>
397
+ <td>
398
+ <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 36</span>
399
+
400
+ <span class='kw'>def</span> <span class='id identifier rubyid_optional'>optional</span>
401
+ <span class='ivar'>@optional</span>
402
+ <span class='kw'>end</span></pre>
403
+ </td>
404
+ </tr>
405
+ </table>
406
+ </div>
407
+
408
+
409
+ <span id=""></span>
410
+ <span id="required-instance_method"></span>
411
+ <div class="method_details ">
412
+ <h3 class="signature " id="required-instance_method">
413
+
414
+ - (<tt>Object</tt>) <strong>required</strong> <span class="extras">(readonly)</span>
415
+
416
+
417
+
418
+
419
+
420
+ </h3><div class="docstring">
421
+ <div class="discussion">
422
+
423
+ <p>Returns the value of attribute required</p>
424
+
425
+
426
+ </div>
427
+ </div>
428
+ <div class="tags">
429
+
430
+
431
+ </div><table class="source_code">
432
+ <tr>
433
+ <td>
434
+ <pre class="lines">
435
+
436
+
437
+ 36
438
+ 37
439
+ 38</pre>
440
+ </td>
441
+ <td>
442
+ <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 36</span>
443
+
444
+ <span class='kw'>def</span> <span class='id identifier rubyid_required'>required</span>
445
+ <span class='ivar'>@required</span>
446
+ <span class='kw'>end</span></pre>
447
+ </td>
448
+ </tr>
449
+ </table>
450
+ </div>
451
+
452
+ </div>
453
+
454
+
455
+ <div id="instance_method_details" class="method_details_list">
456
+ <h2>Instance Method Details</h2>
457
+
458
+
459
+ <div class="method_details first">
460
+ <h3 class="signature first" id="validate_subject-instance_method">
461
+
462
+ - (<tt><span class='object_link'><a href="../Subject.html" title="R509::Subject (class)">R509::Subject</a></span></tt>) <strong>validate_subject</strong>(subject)
463
+
464
+
465
+
466
+
467
+
468
+ </h3><div class="docstring">
469
+ <div class="discussion">
470
+
471
+ <p>Validated version of the subject or error</p>
472
+
473
+
474
+ </div>
475
+ </div>
476
+ <div class="tags">
477
+ <p class="tag_title">Parameters:</p>
478
+ <ul class="param">
479
+
480
+ <li>
481
+
482
+ <span class='name'>subject</span>
483
+
484
+
485
+ <span class='type'>(<tt><span class='object_link'><a href="../Subject.html" title="R509::Subject (class)">R509::Subject</a></span></tt>)</span>
486
+
487
+
488
+
489
+ </li>
490
+
491
+ </ul>
492
+
493
+ <p class="tag_title">Returns:</p>
494
+ <ul class="return">
495
+
496
+ <li>
497
+
498
+
499
+ <span class='type'>(<tt><span class='object_link'><a href="../Subject.html" title="R509::Subject (class)">R509::Subject</a></span></tt>)</span>
500
+
501
+
502
+
503
+ &mdash;
504
+ <div class='inline'>
505
+ <p>validated version of the subject or error</p>
506
+ </div>
507
+
508
+ </li>
509
+
510
+ </ul>
511
+
512
+ </div><table class="source_code">
513
+ <tr>
514
+ <td>
515
+ <pre class="lines">
516
+
517
+
518
+ 68
519
+ 69
520
+ 70
521
+ 71
522
+ 72
523
+ 73
524
+ 74
525
+ 75
526
+ 76
527
+ 77
528
+ 78
529
+ 79
530
+ 80
531
+ 81
532
+ 82
533
+ 83
534
+ 84
535
+ 85
536
+ 86
537
+ 87</pre>
538
+ </td>
539
+ <td>
540
+ <pre class="code"><span class="info file"># File 'lib/r509/config.rb', line 68</span>
541
+
542
+ <span class='kw'>def</span> <span class='id identifier rubyid_validate_subject'>validate_subject</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='rparen'>)</span>
543
+ <span class='comment'># convert the subject components into an array of component names that match
544
+ </span> <span class='comment'># those that are on the required list
545
+ </span> <span class='id identifier rubyid_supplied'>supplied</span> <span class='op'>=</span> <span class='id identifier rubyid_subject'>subject</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
546
+ <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
547
+ <span class='kw'>end</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span>
548
+ <span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
549
+ <span class='kw'>end</span>
550
+ <span class='comment'># so we can make sure they gave us everything that's required
551
+ </span> <span class='id identifier rubyid_diff'>diff</span> <span class='op'>=</span> <span class='ivar'>@required</span> <span class='op'>-</span> <span class='id identifier rubyid_supplied'>supplied</span>
552
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_diff'>diff</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
553
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>This profile requires you supply </span><span class='tstring_end'>&quot;</span></span><span class='op'>+</span><span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>, </span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
554
+ <span class='kw'>end</span>
555
+
556
+ <span class='comment'># the validated subject contains only those subject components that are either
557
+ </span> <span class='comment'># required or optional
558
+ </span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Subject</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_subject'>subject</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</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>
559
+ <span class='ivar'>@required</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='kw'>or</span> <span class='ivar'>@optional</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_item'>item</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rparen'>)</span>
560
+ <span class='kw'>end</span><span class='rparen'>)</span>
561
+ <span class='kw'>end</span></pre>
562
+ </td>
563
+ </tr>
564
+ </table>
565
+ </div>
566
+
567
+ </div>
568
+
569
+ </div>
570
+
571
+ <div id="footer">
572
+ Generated on Tue Oct 23 22:48:02 2012 by
573
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
574
+ 0.8.0 (ruby-1.9.3).
575
+ </div>
576
+
577
+ </body>
578
+ </html>