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,134 @@
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
+ Exception: R509::R509Error
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 (R)</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">R509Error</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>Exception: R509::R509Error
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">StandardError</span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next">StandardError</li>
82
+
83
+ <li class="next">R509::R509Error</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/r509/exceptions.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>An error r509 sometimes raises. You know, when it feels like it.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ </div>
126
+
127
+ <div id="footer">
128
+ Generated on Tue Oct 23 22:48:03 2012 by
129
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
130
+ 0.8.0 (ruby-1.9.3).
131
+ </div>
132
+
133
+ </body>
134
+ </html>
@@ -0,0 +1,1424 @@
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::Spki
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">Spki</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::Spki
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::Spki</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+
88
+
89
+
90
+
91
+
92
+
93
+ <dt class="r2">Includes:</dt>
94
+ <dd class="r2"><span class='object_link'><a href="IOHelpers.html" title="R509::IOHelpers (module)">IOHelpers</a></span></dd>
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="r1 last">Defined in:</dt>
101
+ <dd class="r1 last">lib/r509/spki.rb</dd>
102
+
103
+ </dl>
104
+ <div class="clear"></div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>class for handling SPKAC/SPKI requests (typically generated by the
110
+ &lt;keygen&gt; tag</p>
111
+
112
+
113
+ </div>
114
+ </div>
115
+ <div class="tags">
116
+
117
+
118
+ </div>
119
+
120
+
121
+
122
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
123
+ <ul class="summary">
124
+
125
+ <li class="public ">
126
+ <span class="summary_signature">
127
+
128
+ <a href="#san_names-instance_method" title="#san_names (instance method)">- (Object) <strong>san_names</strong> </a>
129
+
130
+
131
+
132
+ </span>
133
+
134
+
135
+
136
+
137
+ <span class="note title readonly">readonly</span>
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+ <span class="summary_desc"><div class='inline'>
148
+ <p>Returns the value of attribute san_names.</p>
149
+ </div></span>
150
+
151
+ </li>
152
+
153
+
154
+ <li class="public ">
155
+ <span class="summary_signature">
156
+
157
+ <a href="#spki-instance_method" title="#spki (instance method)">- (Object) <strong>spki</strong> </a>
158
+
159
+
160
+
161
+ </span>
162
+
163
+
164
+
165
+
166
+ <span class="note title readonly">readonly</span>
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <span class="summary_desc"><div class='inline'>
177
+ <p>Returns the value of attribute spki.</p>
178
+ </div></span>
179
+
180
+ </li>
181
+
182
+
183
+ <li class="public ">
184
+ <span class="summary_signature">
185
+
186
+ <a href="#subject-instance_method" title="#subject (instance method)">- (Object) <strong>subject</strong> </a>
187
+
188
+
189
+
190
+ </span>
191
+
192
+
193
+
194
+
195
+ <span class="note title readonly">readonly</span>
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+ <span class="summary_desc"><div class='inline'>
206
+ <p>Returns the value of attribute subject.</p>
207
+ </div></span>
208
+
209
+ </li>
210
+
211
+
212
+ </ul>
213
+
214
+
215
+
216
+
217
+
218
+ <h2>
219
+ Instance Method Summary
220
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
221
+ </h2>
222
+
223
+ <ul class="summary">
224
+
225
+ <li class="public ">
226
+ <span class="summary_signature">
227
+
228
+ <a href="#bit_strength-instance_method" title="#bit_strength (instance method)">- (Integer) <strong>bit_strength</strong> </a>
229
+
230
+
231
+
232
+ </span>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+ <span class="summary_desc"><div class='inline'>
243
+ <p>Returns the bit strength of the key used to create the SPKI.</p>
244
+ </div></span>
245
+
246
+ </li>
247
+
248
+
249
+ <li class="public ">
250
+ <span class="summary_signature">
251
+
252
+ <a href="#dsa%3F-instance_method" title="#dsa? (instance method)">- (Boolean) <strong>dsa?</strong> </a>
253
+
254
+
255
+
256
+ </span>
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+ <span class="summary_desc"><div class='inline'>
267
+ <p>Returns whether the public key is DSA.</p>
268
+ </div></span>
269
+
270
+ </li>
271
+
272
+
273
+ <li class="public ">
274
+ <span class="summary_signature">
275
+
276
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Spki) <strong>initialize</strong>(opts = {}) </a>
277
+
278
+
279
+
280
+ </span>
281
+
282
+
283
+ <span class="note title constructor">constructor</span>
284
+
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+ <span class="summary_desc"><div class='inline'>
293
+ <p>you can also pass OIDs (see tests).</p>
294
+ </div></span>
295
+
296
+ </li>
297
+
298
+
299
+ <li class="public ">
300
+ <span class="summary_signature">
301
+
302
+ <a href="#key_algorithm-instance_method" title="#key_algorithm (instance method)">- (String) <strong>key_algorithm</strong> </a>
303
+
304
+
305
+
306
+ </span>
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+ <span class="summary_desc"><div class='inline'>
317
+ <p>Returns key algorithm (RSA/DSA).</p>
318
+ </div></span>
319
+
320
+ </li>
321
+
322
+
323
+ <li class="public ">
324
+ <span class="summary_signature">
325
+
326
+ <a href="#public_key-instance_method" title="#public_key (instance method)">- (OpenSSL::PKey::RSA) <strong>public_key</strong> </a>
327
+
328
+
329
+
330
+ </span>
331
+
332
+
333
+
334
+
335
+
336
+
337
+
338
+
339
+
340
+ <span class="summary_desc"><div class='inline'>
341
+ <p>Public key.</p>
342
+ </div></span>
343
+
344
+ </li>
345
+
346
+
347
+ <li class="public ">
348
+ <span class="summary_signature">
349
+
350
+ <a href="#rsa%3F-instance_method" title="#rsa? (instance method)">- (Boolean) <strong>rsa?</strong> </a>
351
+
352
+
353
+
354
+ </span>
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+ <span class="summary_desc"><div class='inline'>
365
+ <p>Returns whether the public key is RSA.</p>
366
+ </div></span>
367
+
368
+ </li>
369
+
370
+
371
+ <li class="public ">
372
+ <span class="summary_signature">
373
+
374
+ <a href="#to_der-instance_method" title="#to_der (instance method)">- (String) <strong>to_der</strong> </a>
375
+
376
+
377
+
378
+ </span>
379
+
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+ <span class="summary_desc"><div class='inline'>
389
+ <p>Converts the SPKI into the DER format.</p>
390
+ </div></span>
391
+
392
+ </li>
393
+
394
+
395
+ <li class="public ">
396
+ <span class="summary_signature">
397
+
398
+ <a href="#to_hash-instance_method" title="#to_hash (instance method)">- (Hash) <strong>to_hash</strong> </a>
399
+
400
+
401
+
402
+ </span>
403
+
404
+
405
+
406
+
407
+
408
+
409
+
410
+
411
+
412
+ <span class="summary_desc"><div class='inline'>
413
+ <p>Returns a hash structure you can pass to the Ca You will want to call this
414
+ method if you intend to alter the values and then pass them to the Ca
415
+ class.</p>
416
+ </div></span>
417
+
418
+ </li>
419
+
420
+
421
+ <li class="public ">
422
+ <span class="summary_signature">
423
+
424
+ <a href="#to_pem-instance_method" title="#to_pem (instance method)">- (String) <strong>to_pem</strong> </a>
425
+
426
+
427
+
428
+ (also: #to_s)
429
+
430
+ </span>
431
+
432
+
433
+
434
+
435
+
436
+
437
+
438
+
439
+
440
+ <span class="summary_desc"><div class='inline'>
441
+ <p>Converts the SPKI into the PEM format.</p>
442
+ </div></span>
443
+
444
+ </li>
445
+
446
+
447
+ <li class="public ">
448
+ <span class="summary_signature">
449
+
450
+ <a href="#write_der-instance_method" title="#write_der (instance method)">- (Object) <strong>write_der</strong>(filename_or_io) </a>
451
+
452
+
453
+
454
+ </span>
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+ <span class="summary_desc"><div class='inline'>
465
+ <p>Writes the SPKI into the DER format.</p>
466
+ </div></span>
467
+
468
+ </li>
469
+
470
+
471
+ <li class="public ">
472
+ <span class="summary_signature">
473
+
474
+ <a href="#write_pem-instance_method" title="#write_pem (instance method)">- (Object) <strong>write_pem</strong>(filename_or_io) </a>
475
+
476
+
477
+
478
+ </span>
479
+
480
+
481
+
482
+
483
+
484
+
485
+
486
+
487
+
488
+ <span class="summary_desc"><div class='inline'>
489
+ <p>Writes the SPKI into the PEM format.</p>
490
+ </div></span>
491
+
492
+ </li>
493
+
494
+
495
+ </ul>
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="IOHelpers.html" title="R509::IOHelpers (module)">IOHelpers</a></span></h3>
508
+ <p class="inherited"><span class='object_link'><a href="IOHelpers.html#read_data-instance_method" title="R509::IOHelpers#read_data (method)">#read_data</a></span>, <span class='object_link'><a href="IOHelpers.html#read_data-class_method" title="R509::IOHelpers.read_data (method)">read_data</a></span>, <span class='object_link'><a href="IOHelpers.html#write_data-instance_method" title="R509::IOHelpers#write_data (method)">#write_data</a></span>, <span class='object_link'><a href="IOHelpers.html#write_data-class_method" title="R509::IOHelpers.write_data (method)">write_data</a></span></p>
509
+ <div id="constructor_details" class="method_details_list">
510
+ <h2>Constructor Details</h2>
511
+
512
+ <div class="method_details first">
513
+ <h3 class="signature first" id="initialize-instance_method">
514
+
515
+ - (<tt><span class='object_link'><a href="" title="R509::Spki (class)">Spki</a></span></tt>) <strong>initialize</strong>(opts = {})
516
+
517
+
518
+
519
+
520
+
521
+ </h3><div class="docstring">
522
+ <div class="discussion">
523
+
524
+ <p>you can also pass OIDs (see tests)</p>
525
+
526
+
527
+ </div>
528
+ </div>
529
+ <div class="tags">
530
+
531
+ <div class="examples">
532
+ <p class="tag_title">Examples:</p>
533
+
534
+
535
+ <p class="example_title"><div class='inline'><dl class="rdoc-list"><dt>['<a href="http://'ST','Illinois'">CN','langui.sh'],</a>,['<a href="http://'C','US'">L','Chicago'],</a>,['emailAddress','ca@langui.sh']</dt>
536
+ <dd></dd></dl>
537
+ </div></p>
538
+
539
+ <pre class="example code"></pre>
540
+
541
+ </div>
542
+ <p class="tag_title">Parameters:</p>
543
+ <ul class="param">
544
+
545
+ <li>
546
+
547
+ <span class='name'>opts</span>
548
+
549
+
550
+ <span class='type'>(<tt>Hash</tt>)</span>
551
+
552
+
553
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
554
+
555
+
556
+ &mdash;
557
+ <div class='inline'>
558
+ <p>a customizable set of options</p>
559
+ </div>
560
+
561
+ </li>
562
+
563
+ </ul>
564
+
565
+
566
+
567
+
568
+ <p class="tag_title">Options Hash (<tt>opts</tt>):</p>
569
+ <ul class="option">
570
+
571
+ <li>
572
+ <span class="name">:spki</span>
573
+ <span class="type">(<tt>String</tt>, <tt>OpenSSL::Netscape::SPKI</tt>)</span>
574
+ <span class="default">
575
+
576
+ </span>
577
+ &mdash; <div class='inline'>
578
+ <p>the spki you want to parse</p>
579
+ </div>
580
+ </li>
581
+
582
+ <li>
583
+ <span class="name">:subject</span>
584
+ <span class="type">(<tt><span class='object_link'><a href="Subject.html" title="R509::Subject (class)">R509::Subject</a></span></tt>, <tt>Array</tt>, <tt>OpenSSL::X509::Name</tt>)</span>
585
+ <span class="default">
586
+
587
+ </span>
588
+ &mdash; <div class='inline'>
589
+ <p>array of subject items</p>
590
+ </div>
591
+ </li>
592
+
593
+ <li>
594
+ <span class="name">:san_names</span>
595
+ <span class="type">(<tt>Array</tt>)</span>
596
+ <span class="default">
597
+
598
+ </span>
599
+ &mdash; <div class='inline'>
600
+ <p>array of SAN names</p>
601
+ </div>
602
+ </li>
603
+
604
+ </ul>
605
+
606
+
607
+
608
+ </div><table class="source_code">
609
+ <tr>
610
+ <td>
611
+ <pre class="lines">
612
+
613
+
614
+ 16
615
+ 17
616
+ 18
617
+ 19
618
+ 20
619
+ 21
620
+ 22
621
+ 23
622
+ 24
623
+ 25
624
+ 26
625
+ 27
626
+ 28
627
+ 29</pre>
628
+ </td>
629
+ <td>
630
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 16</span>
631
+
632
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
633
+ <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_opts'>opts</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>
634
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Must provide a hash of options</span><span class='tstring_end'>'</span></span>
635
+ <span class='kw'>end</span>
636
+ <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:spki</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:subject</span><span class='rparen'>)</span>
637
+ <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 provide both spki and subject</span><span class='tstring_end'>&quot;</span></span>
638
+ <span class='kw'>end</span>
639
+ <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:san_names</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:san_names</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Array</span><span class='rparen'>)</span>
640
+ <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'>if san_names are provided they must be in an Array</span><span class='tstring_end'>&quot;</span></span>
641
+ <span class='kw'>end</span>
642
+ <span class='ivar'>@spki</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Netscape</span><span class='op'>::</span><span class='const'>SPKI</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:spki</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_sub'>sub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>SPKAC=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span>
643
+ <span class='ivar'>@subject</span> <span class='op'>=</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_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:subject</span><span class='rbracket'>]</span><span class='rparen'>)</span>
644
+ <span class='ivar'>@san_names</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:san_names</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
645
+ <span class='kw'>end</span></pre>
646
+ </td>
647
+ </tr>
648
+ </table>
649
+ </div>
650
+
651
+ </div>
652
+
653
+ <div id="instance_attr_details" class="attr_details">
654
+ <h2>Instance Attribute Details</h2>
655
+
656
+
657
+ <span id=""></span>
658
+ <span id="san_names-instance_method"></span>
659
+ <div class="method_details first">
660
+ <h3 class="signature first" id="san_names-instance_method">
661
+
662
+ - (<tt>Object</tt>) <strong>san_names</strong> <span class="extras">(readonly)</span>
663
+
664
+
665
+
666
+
667
+
668
+ </h3><div class="docstring">
669
+ <div class="discussion">
670
+
671
+ <p>Returns the value of attribute san_names</p>
672
+
673
+
674
+ </div>
675
+ </div>
676
+ <div class="tags">
677
+
678
+
679
+ </div><table class="source_code">
680
+ <tr>
681
+ <td>
682
+ <pre class="lines">
683
+
684
+
685
+ 10
686
+ 11
687
+ 12</pre>
688
+ </td>
689
+ <td>
690
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 10</span>
691
+
692
+ <span class='kw'>def</span> <span class='id identifier rubyid_san_names'>san_names</span>
693
+ <span class='ivar'>@san_names</span>
694
+ <span class='kw'>end</span></pre>
695
+ </td>
696
+ </tr>
697
+ </table>
698
+ </div>
699
+
700
+
701
+ <span id=""></span>
702
+ <span id="spki-instance_method"></span>
703
+ <div class="method_details ">
704
+ <h3 class="signature " id="spki-instance_method">
705
+
706
+ - (<tt>Object</tt>) <strong>spki</strong> <span class="extras">(readonly)</span>
707
+
708
+
709
+
710
+
711
+
712
+ </h3><div class="docstring">
713
+ <div class="discussion">
714
+
715
+ <p>Returns the value of attribute spki</p>
716
+
717
+
718
+ </div>
719
+ </div>
720
+ <div class="tags">
721
+
722
+
723
+ </div><table class="source_code">
724
+ <tr>
725
+ <td>
726
+ <pre class="lines">
727
+
728
+
729
+ 10
730
+ 11
731
+ 12</pre>
732
+ </td>
733
+ <td>
734
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 10</span>
735
+
736
+ <span class='kw'>def</span> <span class='id identifier rubyid_spki'>spki</span>
737
+ <span class='ivar'>@spki</span>
738
+ <span class='kw'>end</span></pre>
739
+ </td>
740
+ </tr>
741
+ </table>
742
+ </div>
743
+
744
+
745
+ <span id=""></span>
746
+ <span id="subject-instance_method"></span>
747
+ <div class="method_details ">
748
+ <h3 class="signature " id="subject-instance_method">
749
+
750
+ - (<tt>Object</tt>) <strong>subject</strong> <span class="extras">(readonly)</span>
751
+
752
+
753
+
754
+
755
+
756
+ </h3><div class="docstring">
757
+ <div class="discussion">
758
+
759
+ <p>Returns the value of attribute subject</p>
760
+
761
+
762
+ </div>
763
+ </div>
764
+ <div class="tags">
765
+
766
+
767
+ </div><table class="source_code">
768
+ <tr>
769
+ <td>
770
+ <pre class="lines">
771
+
772
+
773
+ 10
774
+ 11
775
+ 12</pre>
776
+ </td>
777
+ <td>
778
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 10</span>
779
+
780
+ <span class='kw'>def</span> <span class='id identifier rubyid_subject'>subject</span>
781
+ <span class='ivar'>@subject</span>
782
+ <span class='kw'>end</span></pre>
783
+ </td>
784
+ </tr>
785
+ </table>
786
+ </div>
787
+
788
+ </div>
789
+
790
+
791
+ <div id="instance_method_details" class="method_details_list">
792
+ <h2>Instance Method Details</h2>
793
+
794
+
795
+ <div class="method_details first">
796
+ <h3 class="signature first" id="bit_strength-instance_method">
797
+
798
+ - (<tt>Integer</tt>) <strong>bit_strength</strong>
799
+
800
+
801
+
802
+
803
+
804
+ </h3><div class="docstring">
805
+ <div class="discussion">
806
+
807
+ <p>Returns the bit strength of the key used to create the SPKI</p>
808
+
809
+
810
+ </div>
811
+ </div>
812
+ <div class="tags">
813
+
814
+ <p class="tag_title">Returns:</p>
815
+ <ul class="return">
816
+
817
+ <li>
818
+
819
+
820
+ <span class='type'>(<tt>Integer</tt>)</span>
821
+
822
+
823
+
824
+ &mdash;
825
+ <div class='inline'>
826
+ <p>the integer bit strength.</p>
827
+ </div>
828
+
829
+ </li>
830
+
831
+ </ul>
832
+
833
+ </div><table class="source_code">
834
+ <tr>
835
+ <td>
836
+ <pre class="lines">
837
+
838
+
839
+ 84
840
+ 85
841
+ 86
842
+ 87
843
+ 88
844
+ 89
845
+ 90</pre>
846
+ </td>
847
+ <td>
848
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 84</span>
849
+
850
+ <span class='kw'>def</span> <span class='id identifier rubyid_bit_strength'>bit_strength</span>
851
+ <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_rsa?'>rsa?</span>
852
+ <span class='kw'>return</span> <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_n'>n</span><span class='period'>.</span><span class='id identifier rubyid_num_bits'>num_bits</span>
853
+ <span class='kw'>elsif</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dsa?'>dsa?</span>
854
+ <span class='kw'>return</span> <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_num_bits'>num_bits</span>
855
+ <span class='kw'>end</span>
856
+ <span class='kw'>end</span></pre>
857
+ </td>
858
+ </tr>
859
+ </table>
860
+ </div>
861
+
862
+ <div class="method_details ">
863
+ <h3 class="signature " id="dsa?-instance_method">
864
+
865
+ - (<tt>Boolean</tt>) <strong>dsa?</strong>
866
+
867
+
868
+
869
+
870
+
871
+ </h3><div class="docstring">
872
+ <div class="discussion">
873
+
874
+ <p>Returns whether the public key is DSA</p>
875
+
876
+
877
+ </div>
878
+ </div>
879
+ <div class="tags">
880
+
881
+ <p class="tag_title">Returns:</p>
882
+ <ul class="return">
883
+
884
+ <li>
885
+
886
+
887
+ <span class='type'>(<tt>Boolean</tt>)</span>
888
+
889
+
890
+
891
+ &mdash;
892
+ <div class='inline'>
893
+ <p>true if the public key is DSA, false otherwise</p>
894
+ </div>
895
+
896
+ </li>
897
+
898
+ </ul>
899
+
900
+ </div><table class="source_code">
901
+ <tr>
902
+ <td>
903
+ <pre class="lines">
904
+
905
+
906
+ 78
907
+ 79
908
+ 80</pre>
909
+ </td>
910
+ <td>
911
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 78</span>
912
+
913
+ <span class='kw'>def</span> <span class='id identifier rubyid_dsa?'>dsa?</span>
914
+ <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKey</span><span class='op'>::</span><span class='const'>DSA</span><span class='rparen'>)</span>
915
+ <span class='kw'>end</span></pre>
916
+ </td>
917
+ </tr>
918
+ </table>
919
+ </div>
920
+
921
+ <div class="method_details ">
922
+ <h3 class="signature " id="key_algorithm-instance_method">
923
+
924
+ - (<tt>String</tt>) <strong>key_algorithm</strong>
925
+
926
+
927
+
928
+
929
+
930
+ </h3><div class="docstring">
931
+ <div class="discussion">
932
+
933
+ <p>Returns key algorithm (RSA/DSA)</p>
934
+
935
+
936
+ </div>
937
+ </div>
938
+ <div class="tags">
939
+
940
+ <p class="tag_title">Returns:</p>
941
+ <ul class="return">
942
+
943
+ <li>
944
+
945
+
946
+ <span class='type'>(<tt>String</tt>)</span>
947
+
948
+
949
+
950
+ &mdash;
951
+ <div class='inline'>
952
+ <p>value of the key algorithm. RSA or DSA</p>
953
+ </div>
954
+
955
+ </li>
956
+
957
+ </ul>
958
+
959
+ </div><table class="source_code">
960
+ <tr>
961
+ <td>
962
+ <pre class="lines">
963
+
964
+
965
+ 95
966
+ 96
967
+ 97
968
+ 98
969
+ 99
970
+ 100
971
+ 101</pre>
972
+ </td>
973
+ <td>
974
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 95</span>
975
+
976
+ <span class='kw'>def</span> <span class='id identifier rubyid_key_algorithm'>key_algorithm</span>
977
+ <span class='kw'>if</span> <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKey</span><span class='op'>::</span><span class='const'>RSA</span> <span class='kw'>then</span>
978
+ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>RSA</span><span class='tstring_end'>'</span></span>
979
+ <span class='kw'>elsif</span> <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKey</span><span class='op'>::</span><span class='const'>DSA</span> <span class='kw'>then</span>
980
+ <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>DSA</span><span class='tstring_end'>'</span></span>
981
+ <span class='kw'>end</span>
982
+ <span class='kw'>end</span></pre>
983
+ </td>
984
+ </tr>
985
+ </table>
986
+ </div>
987
+
988
+ <div class="method_details ">
989
+ <h3 class="signature " id="public_key-instance_method">
990
+
991
+ - (<tt>OpenSSL::PKey::RSA</tt>) <strong>public_key</strong>
992
+
993
+
994
+
995
+
996
+
997
+ </h3><div class="docstring">
998
+ <div class="discussion">
999
+
1000
+ <p>Public key</p>
1001
+
1002
+
1003
+ </div>
1004
+ </div>
1005
+ <div class="tags">
1006
+
1007
+ <p class="tag_title">Returns:</p>
1008
+ <ul class="return">
1009
+
1010
+ <li>
1011
+
1012
+
1013
+ <span class='type'>(<tt>OpenSSL::PKey::RSA</tt>)</span>
1014
+
1015
+
1016
+
1017
+ &mdash;
1018
+ <div class='inline'>
1019
+ <p>public key</p>
1020
+ </div>
1021
+
1022
+ </li>
1023
+
1024
+ </ul>
1025
+
1026
+ </div><table class="source_code">
1027
+ <tr>
1028
+ <td>
1029
+ <pre class="lines">
1030
+
1031
+
1032
+ 32
1033
+ 33
1034
+ 34</pre>
1035
+ </td>
1036
+ <td>
1037
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 32</span>
1038
+
1039
+ <span class='kw'>def</span> <span class='id identifier rubyid_public_key'>public_key</span>
1040
+ <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span>
1041
+ <span class='kw'>end</span></pre>
1042
+ </td>
1043
+ </tr>
1044
+ </table>
1045
+ </div>
1046
+
1047
+ <div class="method_details ">
1048
+ <h3 class="signature " id="rsa?-instance_method">
1049
+
1050
+ - (<tt>Boolean</tt>) <strong>rsa?</strong>
1051
+
1052
+
1053
+
1054
+
1055
+
1056
+ </h3><div class="docstring">
1057
+ <div class="discussion">
1058
+
1059
+ <p>Returns whether the public key is RSA</p>
1060
+
1061
+
1062
+ </div>
1063
+ </div>
1064
+ <div class="tags">
1065
+
1066
+ <p class="tag_title">Returns:</p>
1067
+ <ul class="return">
1068
+
1069
+ <li>
1070
+
1071
+
1072
+ <span class='type'>(<tt>Boolean</tt>)</span>
1073
+
1074
+
1075
+
1076
+ &mdash;
1077
+ <div class='inline'>
1078
+ <p>true if the public key is RSA, false otherwise</p>
1079
+ </div>
1080
+
1081
+ </li>
1082
+
1083
+ </ul>
1084
+
1085
+ </div><table class="source_code">
1086
+ <tr>
1087
+ <td>
1088
+ <pre class="lines">
1089
+
1090
+
1091
+ 71
1092
+ 72
1093
+ 73</pre>
1094
+ </td>
1095
+ <td>
1096
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 71</span>
1097
+
1098
+ <span class='kw'>def</span> <span class='id identifier rubyid_rsa?'>rsa?</span>
1099
+ <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>PKey</span><span class='op'>::</span><span class='const'>RSA</span><span class='rparen'>)</span>
1100
+ <span class='kw'>end</span></pre>
1101
+ </td>
1102
+ </tr>
1103
+ </table>
1104
+ </div>
1105
+
1106
+ <div class="method_details ">
1107
+ <h3 class="signature " id="to_der-instance_method">
1108
+
1109
+ - (<tt>String</tt>) <strong>to_der</strong>
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+ </h3><div class="docstring">
1116
+ <div class="discussion">
1117
+
1118
+ <p>Converts the SPKI into the DER format</p>
1119
+
1120
+
1121
+ </div>
1122
+ </div>
1123
+ <div class="tags">
1124
+
1125
+ <p class="tag_title">Returns:</p>
1126
+ <ul class="return">
1127
+
1128
+ <li>
1129
+
1130
+
1131
+ <span class='type'>(<tt>String</tt>)</span>
1132
+
1133
+
1134
+
1135
+ &mdash;
1136
+ <div class='inline'>
1137
+ <p>the SPKI converted into DER format.</p>
1138
+ </div>
1139
+
1140
+ </li>
1141
+
1142
+ </ul>
1143
+
1144
+ </div><table class="source_code">
1145
+ <tr>
1146
+ <td>
1147
+ <pre class="lines">
1148
+
1149
+
1150
+ 48
1151
+ 49
1152
+ 50</pre>
1153
+ </td>
1154
+ <td>
1155
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 48</span>
1156
+
1157
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_der'>to_der</span>
1158
+ <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span>
1159
+ <span class='kw'>end</span></pre>
1160
+ </td>
1161
+ </tr>
1162
+ </table>
1163
+ </div>
1164
+
1165
+ <div class="method_details ">
1166
+ <h3 class="signature " id="to_hash-instance_method">
1167
+
1168
+ - (<tt>Hash</tt>) <strong>to_hash</strong>
1169
+
1170
+
1171
+
1172
+
1173
+
1174
+ </h3><div class="docstring">
1175
+ <div class="discussion">
1176
+
1177
+ <p>Returns a hash structure you can pass to the Ca You will want to call this
1178
+ method if you intend to alter the values and then pass them to the Ca
1179
+ class.</p>
1180
+
1181
+
1182
+ </div>
1183
+ </div>
1184
+ <div class="tags">
1185
+
1186
+ <p class="tag_title">Returns:</p>
1187
+ <ul class="return">
1188
+
1189
+ <li>
1190
+
1191
+
1192
+ <span class='type'>(<tt>Hash</tt>)</span>
1193
+
1194
+
1195
+
1196
+ &mdash;
1197
+ <div class='inline'>
1198
+ <p>:subject and :san_names you can pass to Ca</p>
1199
+ </div>
1200
+
1201
+ </li>
1202
+
1203
+ </ul>
1204
+
1205
+ </div><table class="source_code">
1206
+ <tr>
1207
+ <td>
1208
+ <pre class="lines">
1209
+
1210
+
1211
+ 108
1212
+ 109
1213
+ 110</pre>
1214
+ </td>
1215
+ <td>
1216
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 108</span>
1217
+
1218
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_hash'>to_hash</span>
1219
+ <span class='lbrace'>{</span> <span class='symbol'>:subject</span> <span class='op'>=&gt;</span> <span class='ivar'>@subject</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span> <span class='comma'>,</span> <span class='symbol'>:san_names</span> <span class='op'>=&gt;</span> <span class='ivar'>@san_names</span><span class='period'>.</span><span class='id identifier rubyid_dup'>dup</span> <span class='rbrace'>}</span>
1220
+ <span class='kw'>end</span></pre>
1221
+ </td>
1222
+ </tr>
1223
+ </table>
1224
+ </div>
1225
+
1226
+ <div class="method_details ">
1227
+ <h3 class="signature " id="to_pem-instance_method">
1228
+
1229
+ - (<tt>String</tt>) <strong>to_pem</strong>
1230
+
1231
+
1232
+
1233
+ <span class="aliases">Also known as:
1234
+ <span class="names"><span id='to_s-instance_method'>to_s</span></span>
1235
+ </span>
1236
+
1237
+
1238
+
1239
+ </h3><div class="docstring">
1240
+ <div class="discussion">
1241
+
1242
+ <p>Converts the SPKI into the PEM format</p>
1243
+
1244
+
1245
+ </div>
1246
+ </div>
1247
+ <div class="tags">
1248
+
1249
+ <p class="tag_title">Returns:</p>
1250
+ <ul class="return">
1251
+
1252
+ <li>
1253
+
1254
+
1255
+ <span class='type'>(<tt>String</tt>)</span>
1256
+
1257
+
1258
+
1259
+ &mdash;
1260
+ <div class='inline'>
1261
+ <p>the SPKI converted into PEM format.</p>
1262
+ </div>
1263
+
1264
+ </li>
1265
+
1266
+ </ul>
1267
+
1268
+ </div><table class="source_code">
1269
+ <tr>
1270
+ <td>
1271
+ <pre class="lines">
1272
+
1273
+
1274
+ 39
1275
+ 40
1276
+ 41</pre>
1277
+ </td>
1278
+ <td>
1279
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 39</span>
1280
+
1281
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_pem'>to_pem</span>
1282
+ <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span>
1283
+ <span class='kw'>end</span></pre>
1284
+ </td>
1285
+ </tr>
1286
+ </table>
1287
+ </div>
1288
+
1289
+ <div class="method_details ">
1290
+ <h3 class="signature " id="write_der-instance_method">
1291
+
1292
+ - (<tt>Object</tt>) <strong>write_der</strong>(filename_or_io)
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+ </h3><div class="docstring">
1299
+ <div class="discussion">
1300
+
1301
+ <p>Writes the SPKI into the DER format</p>
1302
+
1303
+
1304
+ </div>
1305
+ </div>
1306
+ <div class="tags">
1307
+ <p class="tag_title">Parameters:</p>
1308
+ <ul class="param">
1309
+
1310
+ <li>
1311
+
1312
+ <span class='name'>filename_or_io</span>
1313
+
1314
+
1315
+ <span class='type'>(<tt>String</tt>, <tt>#write</tt>)</span>
1316
+
1317
+
1318
+
1319
+ &mdash;
1320
+ <div class='inline'>
1321
+ <p>Either a string of the path for the file that you'd like to write, or an
1322
+ IO-like object.</p>
1323
+ </div>
1324
+
1325
+ </li>
1326
+
1327
+ </ul>
1328
+
1329
+
1330
+ </div><table class="source_code">
1331
+ <tr>
1332
+ <td>
1333
+ <pre class="lines">
1334
+
1335
+
1336
+ 64
1337
+ 65
1338
+ 66</pre>
1339
+ </td>
1340
+ <td>
1341
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 64</span>
1342
+
1343
+ <span class='kw'>def</span> <span class='id identifier rubyid_write_der'>write_der</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='rparen'>)</span>
1344
+ <span class='id identifier rubyid_write_data'>write_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='comma'>,</span> <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span><span class='rparen'>)</span>
1345
+ <span class='kw'>end</span></pre>
1346
+ </td>
1347
+ </tr>
1348
+ </table>
1349
+ </div>
1350
+
1351
+ <div class="method_details ">
1352
+ <h3 class="signature " id="write_pem-instance_method">
1353
+
1354
+ - (<tt>Object</tt>) <strong>write_pem</strong>(filename_or_io)
1355
+
1356
+
1357
+
1358
+
1359
+
1360
+ </h3><div class="docstring">
1361
+ <div class="discussion">
1362
+
1363
+ <p>Writes the SPKI into the PEM format</p>
1364
+
1365
+
1366
+ </div>
1367
+ </div>
1368
+ <div class="tags">
1369
+ <p class="tag_title">Parameters:</p>
1370
+ <ul class="param">
1371
+
1372
+ <li>
1373
+
1374
+ <span class='name'>filename_or_io</span>
1375
+
1376
+
1377
+ <span class='type'>(<tt>String</tt>, <tt>#write</tt>)</span>
1378
+
1379
+
1380
+
1381
+ &mdash;
1382
+ <div class='inline'>
1383
+ <p>Either a string of the path for the file that you'd like to write, or an
1384
+ IO-like object.</p>
1385
+ </div>
1386
+
1387
+ </li>
1388
+
1389
+ </ul>
1390
+
1391
+
1392
+ </div><table class="source_code">
1393
+ <tr>
1394
+ <td>
1395
+ <pre class="lines">
1396
+
1397
+
1398
+ 56
1399
+ 57
1400
+ 58</pre>
1401
+ </td>
1402
+ <td>
1403
+ <pre class="code"><span class="info file"># File 'lib/r509/spki.rb', line 56</span>
1404
+
1405
+ <span class='kw'>def</span> <span class='id identifier rubyid_write_pem'>write_pem</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='rparen'>)</span>
1406
+ <span class='id identifier rubyid_write_data'>write_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename_or_io'>filename_or_io</span><span class='comma'>,</span> <span class='ivar'>@spki</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span><span class='rparen'>)</span>
1407
+ <span class='kw'>end</span></pre>
1408
+ </td>
1409
+ </tr>
1410
+ </table>
1411
+ </div>
1412
+
1413
+ </div>
1414
+
1415
+ </div>
1416
+
1417
+ <div id="footer">
1418
+ Generated on Tue Oct 23 22:48:02 2012 by
1419
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1420
+ 0.8.0 (ruby-1.9.3).
1421
+ </div>
1422
+
1423
+ </body>
1424
+ </html>