r509 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +2 -0
- data/CONTRIBUTING.mdown +21 -0
- data/LICENSE +13 -0
- data/README.mdown +548 -0
- data/Rakefile +5 -0
- data/bin/r509 +16 -17
- data/doc/R509.html +42 -26
- data/doc/R509/ASN1.html +22 -16
- data/doc/R509/ASN1/GeneralName.html +180 -173
- data/doc/R509/ASN1/GeneralNames.html +390 -62
- data/doc/R509/CRL.html +9 -7
- data/doc/R509/CRL/Administrator.html +208 -623
- data/doc/R509/CRL/FileReaderWriter.html +856 -0
- data/doc/R509/CRL/ReaderWriter.html +524 -0
- data/doc/R509/CRL/SignedList.html +29 -42
- data/doc/R509/CSR.html +248 -333
- data/doc/R509/Cert.html +364 -491
- data/doc/R509/Cert/Extensions.html +134 -43
- data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +335 -65
- data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +201 -102
- data/doc/R509/Cert/Extensions/BasicConstraints.html +297 -68
- data/doc/R509/Cert/Extensions/CRLDistributionPoints.html +690 -77
- data/doc/R509/Cert/Extensions/CertificatePolicies.html +293 -43
- data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +321 -173
- data/doc/R509/Cert/Extensions/GeneralNamesMixin.html +656 -0
- data/doc/R509/Cert/Extensions/InhibitAnyPolicy.html +270 -42
- data/doc/R509/Cert/Extensions/KeyUsage.html +334 -184
- data/doc/R509/Cert/Extensions/NameConstraints.html +363 -93
- data/doc/R509/{ASN1 → Cert/Extensions}/NoticeReference.html +209 -48
- data/doc/R509/Cert/Extensions/OCSPNoCheck.html +244 -17
- data/doc/R509/Cert/Extensions/PolicyConstraints.html +322 -71
- data/doc/R509/{ASN1 → Cert/Extensions}/PolicyInformation.html +204 -43
- data/doc/R509/{ASN1 → Cert/Extensions}/PolicyQualifiers.html +205 -48
- data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +348 -143
- data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +165 -13
- data/doc/R509/{ASN1 → Cert/Extensions}/UserNotice.html +204 -43
- data/doc/R509/Cert/Extensions/ValidationMixin.html +120 -0
- data/doc/R509/CertificateAuthority.html +9 -7
- data/doc/R509/CertificateAuthority/OptionsBuilder.html +475 -0
- data/doc/R509/CertificateAuthority/Signer.html +149 -198
- data/doc/R509/Config.html +10 -8
- data/doc/R509/Config/CAConfig.html +708 -625
- data/doc/R509/Config/CAConfigPool.html +179 -31
- data/doc/R509/Config/CertProfile.html +1544 -0
- data/doc/R509/Config/SubjectItemPolicy.html +437 -99
- data/doc/R509/Engine.html +14 -28
- data/doc/R509/Helpers.html +1014 -0
- data/doc/R509/MessageDigest.html +73 -25
- data/doc/R509/NameSanitizer.html +39 -39
- data/doc/R509/OCSP.html +5 -5
- data/doc/R509/OCSP/Request.html +5 -5
- data/doc/R509/OCSP/Request/Nonce.html +5 -5
- data/doc/R509/OCSP/Response.html +7 -7
- data/doc/R509/OIDMapper.html +121 -6
- data/doc/R509/PrivateKey.html +226 -227
- data/doc/R509/R509Error.html +5 -5
- data/doc/R509/SPKI.html +244 -342
- data/doc/R509/Subject.html +241 -70
- data/doc/R509/Validity.html +5 -5
- data/doc/R509/Validity/Checker.html +5 -5
- data/doc/R509/Validity/DefaultChecker.html +5 -9
- data/doc/R509/Validity/DefaultWriter.html +5 -9
- data/doc/R509/Validity/Status.html +5 -5
- data/doc/R509/Validity/Writer.html +5 -5
- data/doc/_index.html +92 -30
- data/doc/class_list.html +2 -2
- data/doc/file.CONTRIBUTING.html +96 -0
- data/doc/file.LICENSE.html +87 -0
- data/doc/file.README.html +279 -389
- data/doc/file.YAML.html +243 -0
- data/doc/file.r509.html +298 -105
- data/doc/file_list.html +11 -2
- data/doc/frames.html +1 -1
- data/doc/index.html +279 -389
- data/doc/js/full_list.js +6 -1
- data/doc/method_list.html +869 -1139
- data/doc/top-level-namespace.html +103 -5
- data/lib/r509.rb +7 -2
- data/lib/r509/asn1.rb +97 -135
- data/lib/r509/cert.rb +17 -106
- data/lib/r509/cert/extensions.rb +13 -676
- data/lib/r509/cert/extensions/authority_info_access.rb +128 -0
- data/lib/r509/cert/extensions/authority_key_identifier.rb +100 -0
- data/lib/r509/cert/extensions/base.rb +142 -0
- data/lib/r509/cert/extensions/basic_constraints.rb +119 -0
- data/lib/r509/cert/extensions/certificate_policies.rb +262 -0
- data/lib/r509/cert/extensions/crl_distribution_points.rb +98 -0
- data/lib/r509/cert/extensions/extended_key_usage.rb +189 -0
- data/lib/r509/cert/extensions/inhibit_any_policy.rb +70 -0
- data/lib/r509/cert/extensions/key_usage.rb +209 -0
- data/lib/r509/cert/extensions/name_constraints.rb +179 -0
- data/lib/r509/cert/extensions/ocsp_no_check.rb +56 -0
- data/lib/r509/cert/extensions/policy_constraints.rb +122 -0
- data/lib/r509/cert/extensions/subject_alternative_name.rb +88 -0
- data/lib/r509/cert/extensions/subject_key_identifier.rb +56 -0
- data/lib/r509/cert/extensions/validation_mixin.rb +42 -0
- data/lib/r509/certificate_authority/options_builder.rb +142 -0
- data/lib/r509/certificate_authority/signer.rb +189 -0
- data/lib/r509/config.rb +3 -600
- data/lib/r509/config/ca_config.rb +414 -0
- data/lib/r509/config/cert_profile.rb +110 -0
- data/lib/r509/config/subject_item_policy.rb +118 -0
- data/lib/r509/crl/administrator.rb +169 -0
- data/lib/r509/crl/reader_writer.rb +109 -0
- data/lib/r509/crl/signed_list.rb +135 -0
- data/lib/r509/csr.rb +35 -116
- data/lib/r509/engine.rb +21 -11
- data/lib/r509/helpers.rb +110 -0
- data/lib/r509/io_helpers.rb +18 -13
- data/lib/r509/message_digest.rb +13 -3
- data/lib/r509/oid_mapper.rb +14 -0
- data/lib/r509/private_key.rb +74 -50
- data/lib/r509/spki.rb +50 -113
- data/lib/r509/subject.rb +24 -2
- data/lib/r509/trollop.rb +788 -0
- data/lib/r509/version.rb +1 -1
- data/r509.yaml +289 -96
- data/spec/asn1_spec.rb +171 -98
- data/spec/cert/extensions/authority_info_access_spec.rb +247 -0
- data/spec/cert/extensions/authority_key_identifier_spec.rb +85 -0
- data/spec/cert/extensions/base_spec.rb +172 -0
- data/spec/cert/extensions/basic_constraints_spec.rb +185 -0
- data/spec/cert/extensions/certificate_policies_spec.rb +288 -0
- data/spec/cert/extensions/crl_distribution_points_spec.rb +149 -0
- data/spec/cert/extensions/extended_key_usage_spec.rb +174 -0
- data/spec/cert/extensions/inhibit_any_policy_spec.rb +92 -0
- data/spec/cert/extensions/key_usage_spec.rb +172 -0
- data/spec/cert/extensions/name_constraints_spec.rb +335 -0
- data/spec/cert/extensions/ocsp_no_check_spec.rb +76 -0
- data/spec/cert/extensions/policy_constraints_spec.rb +155 -0
- data/spec/cert/extensions/subject_alternative_name_spec.rb +354 -0
- data/spec/cert/extensions/subject_key_identifier_spec.rb +64 -0
- data/spec/cert_spec.rb +11 -9
- data/spec/certificate_authority/options_builder_spec.rb +307 -0
- data/spec/certificate_authority/signer_spec.rb +278 -0
- data/spec/config/ca_config_spec.rb +405 -0
- data/spec/config/cert_profile_spec.rb +88 -0
- data/spec/config/subject_item_policy_spec.rb +81 -0
- data/spec/crl/administrator_spec.rb +199 -0
- data/spec/crl/reader_writer_spec.rb +97 -0
- data/spec/crl/signed_list_spec.rb +84 -0
- data/spec/csr_spec.rb +43 -36
- data/spec/engine_spec.rb +51 -0
- data/spec/fixtures.rb +40 -40
- data/spec/fixtures/cert1.pem +1 -1
- data/spec/fixtures/config_pool_test_minimal.yaml +11 -15
- data/spec/fixtures/config_test.yaml +96 -59
- data/spec/fixtures/config_test_dsa.yaml +29 -35
- data/spec/fixtures/config_test_ec.yaml +29 -35
- data/spec/fixtures/config_test_engine_key.yaml +7 -7
- data/spec/fixtures/config_test_engine_no_key_name.yaml +6 -6
- data/spec/fixtures/config_test_minimal.yaml +3 -5
- data/spec/fixtures/config_test_password.yaml +4 -6
- data/spec/fixtures/config_test_various.yaml +147 -137
- data/spec/fixtures/crl_list_file.txt +1 -1
- data/spec/fixtures/test_ca_crl.cer +20 -0
- data/spec/fixtures/test_ca_crl.key +28 -0
- data/spec/fixtures/test_ca_crl.p12 +0 -0
- data/spec/message_digest_spec.rb +6 -0
- data/spec/oid_mapper_spec.rb +11 -0
- data/spec/private_key_spec.rb +19 -18
- data/spec/spec_helper.rb +10 -6
- data/spec/spki_spec.rb +38 -19
- data/spec/subject_spec.rb +16 -0
- metadata +108 -59
- metadata.gz.sig +0 -0
- data/README.md +0 -638
- data/doc/R509/Config/CAProfile.html +0 -1015
- data/doc/R509/IOHelpers.html +0 -564
- data/lib/r509/certificate_authority.rb +0 -407
- data/lib/r509/crl.rb +0 -351
- data/spec/cert/extensions_spec.rb +0 -1095
- data/spec/certificate_authority_spec.rb +0 -681
- data/spec/config_spec.rb +0 -562
- data/spec/crl_spec.rb +0 -226
@@ -6,13 +6,13 @@
|
|
6
6
|
<title>
|
7
7
|
Class: R509::CRL::SignedList
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
@@ -90,15 +90,11 @@
|
|
90
90
|
|
91
91
|
|
92
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
93
|
|
98
94
|
|
99
95
|
|
100
|
-
<dt class="
|
101
|
-
<dd class="
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
97
|
+
<dd class="r2 last">lib/r509/crl/signed_list.rb</dd>
|
102
98
|
|
103
99
|
</dl>
|
104
100
|
<div class="clear"></div>
|
@@ -519,16 +515,7 @@ certificate (call cert.public_key on that object).</p>
|
|
519
515
|
|
520
516
|
|
521
517
|
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="../IOHelpers.html" title="R509::IOHelpers (module)">IOHelpers</a></span></h3>
|
530
|
-
<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>
|
531
|
-
<div id="constructor_details" class="method_details_list">
|
518
|
+
<div id="constructor_details" class="method_details_list">
|
532
519
|
<h2>Constructor Details</h2>
|
533
520
|
|
534
521
|
<div class="method_details first">
|
@@ -578,7 +565,7 @@ certificate (call cert.public_key on that object).</p>
|
|
578
565
|
19</pre>
|
579
566
|
</td>
|
580
567
|
<td>
|
581
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 16</span>
|
568
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 16</span>
|
582
569
|
|
583
570
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_crl'>crl</span><span class='rparen'>)</span>
|
584
571
|
<span class='ivar'>@crl</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>X509</span><span class='op'>::</span><span class='const'>CRL</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_crl'>crl</span><span class='rparen'>)</span>
|
@@ -627,7 +614,7 @@ certificate (call cert.public_key on that object).</p>
|
|
627
614
|
15</pre>
|
628
615
|
</td>
|
629
616
|
<td>
|
630
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 13</span>
|
617
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 13</span>
|
631
618
|
|
632
619
|
<span class='kw'>def</span> <span class='id identifier rubyid_crl'>crl</span>
|
633
620
|
<span class='ivar'>@crl</span>
|
@@ -670,7 +657,7 @@ certificate (call cert.public_key on that object).</p>
|
|
670
657
|
15</pre>
|
671
658
|
</td>
|
672
659
|
<td>
|
673
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 13</span>
|
660
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 13</span>
|
674
661
|
|
675
662
|
<span class='kw'>def</span> <span class='id identifier rubyid_issuer'>issuer</span>
|
676
663
|
<span class='ivar'>@issuer</span>
|
@@ -756,7 +743,7 @@ certificate (call cert.public_key on that object).</p>
|
|
756
743
|
27</pre>
|
757
744
|
</td>
|
758
745
|
<td>
|
759
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 25</span>
|
746
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 25</span>
|
760
747
|
|
761
748
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load_from_file'>load_from_file</span><span class='lparen'>(</span> <span class='id identifier rubyid_filename'>filename</span> <span class='rparen'>)</span>
|
762
749
|
<span class='kw'>return</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>CRL</span><span class='op'>::</span><span class='const'>SignedList</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='const'>IOHelpers</span><span class='period'>.</span><span class='id identifier rubyid_read_data'>read_data</span><span class='lparen'>(</span><span class='id identifier rubyid_filename'>filename</span><span class='rparen'>)</span> <span class='rparen'>)</span>
|
@@ -821,7 +808,7 @@ certificate (call cert.public_key on that object).</p>
|
|
821
808
|
55</pre>
|
822
809
|
</td>
|
823
810
|
<td>
|
824
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 53</span>
|
811
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 53</span>
|
825
812
|
|
826
813
|
<span class='kw'>def</span> <span class='id identifier rubyid_last_update'>last_update</span>
|
827
814
|
<span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_last_update'>last_update</span>
|
@@ -880,7 +867,7 @@ certificate (call cert.public_key on that object).</p>
|
|
880
867
|
62</pre>
|
881
868
|
</td>
|
882
869
|
<td>
|
883
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 60</span>
|
870
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 60</span>
|
884
871
|
|
885
872
|
<span class='kw'>def</span> <span class='id identifier rubyid_next_update'>next_update</span>
|
886
873
|
<span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_next_update'>next_update</span>
|
@@ -945,7 +932,7 @@ certificate (call cert.public_key on that object).</p>
|
|
945
932
|
107</pre>
|
946
933
|
</td>
|
947
934
|
<td>
|
948
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 99</span>
|
935
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 99</span>
|
949
936
|
|
950
937
|
<span class='kw'>def</span> <span class='id identifier rubyid_revoked'>revoked</span>
|
951
938
|
<span class='id identifier rubyid_revoked_list'>revoked_list</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -1027,10 +1014,10 @@ certificate (call cert.public_key on that object).</p>
|
|
1027
1014
|
80</pre>
|
1028
1015
|
</td>
|
1029
1016
|
<td>
|
1030
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 74</span>
|
1017
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 74</span>
|
1031
1018
|
|
1032
1019
|
<span class='kw'>def</span> <span class='id identifier rubyid_revoked?'>revoked?</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
|
1033
|
-
<span class='kw'>if</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_revoked'>revoked</span><span class='op'>|</span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span> <span class='op'>==</span> <span class='id identifier rubyid_serial'>serial</span> <span class='rbrace'>}</span>
|
1020
|
+
<span class='kw'>if</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_revoked'>revoked</span><span class='op'>|</span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span> <span class='op'>==</span> <span class='id identifier rubyid_serial'>serial</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='rbrace'>}</span>
|
1034
1021
|
<span class='kw'>true</span>
|
1035
1022
|
<span class='kw'>else</span>
|
1036
1023
|
<span class='kw'>false</span>
|
@@ -1116,10 +1103,10 @@ certificate (call cert.public_key on that object).</p>
|
|
1116
1103
|
119</pre>
|
1117
1104
|
</td>
|
1118
1105
|
<td>
|
1119
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 111</span>
|
1106
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 111</span>
|
1120
1107
|
|
1121
1108
|
<span class='kw'>def</span> <span class='id identifier rubyid_revoked_cert'>revoked_cert</span><span class='lparen'>(</span><span class='id identifier rubyid_serial'>serial</span><span class='rparen'>)</span>
|
1122
|
-
<span class='id identifier rubyid_revoked'>revoked</span> <span class='op'>=</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier
|
1109
|
+
<span class='id identifier rubyid_revoked'>revoked</span> <span class='op'>=</span> <span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_r'>r</span><span class='op'>|</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span> <span class='op'>==</span> <span class='id identifier rubyid_serial'>serial</span> <span class='rbrace'>}</span>
|
1123
1110
|
<span class='kw'>if</span> <span class='id identifier rubyid_revoked'>revoked</span>
|
1124
1111
|
<span class='id identifier rubyid_reason'>reason</span> <span class='op'>=</span> <span class='id identifier rubyid_get_reason'>get_reason</span><span class='lparen'>(</span><span class='id identifier rubyid_revoked'>revoked</span><span class='rparen'>)</span>
|
1125
1112
|
<span class='lbrace'>{</span> <span class='symbol'>:time</span> <span class='op'>=></span> <span class='id identifier rubyid_revoked'>revoked</span><span class='period'>.</span><span class='id identifier rubyid_time'>time</span><span class='comma'>,</span> <span class='symbol'>:reason</span> <span class='op'>=></span> <span class='id identifier rubyid_reason'>reason</span> <span class='rbrace'>}</span>
|
@@ -1174,7 +1161,7 @@ certificate (call cert.public_key on that object).</p>
|
|
1174
1161
|
32</pre>
|
1175
1162
|
</td>
|
1176
1163
|
<td>
|
1177
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 30</span>
|
1164
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 30</span>
|
1178
1165
|
|
1179
1166
|
<span class='kw'>def</span> <span class='id identifier rubyid_signature_algorithm'>signature_algorithm</span>
|
1180
1167
|
<span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_signature_algorithm'>signature_algorithm</span>
|
@@ -1233,7 +1220,7 @@ certificate (call cert.public_key on that object).</p>
|
|
1233
1220
|
96</pre>
|
1234
1221
|
</td>
|
1235
1222
|
<td>
|
1236
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 94</span>
|
1223
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 94</span>
|
1237
1224
|
|
1238
1225
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_der'>to_der</span>
|
1239
1226
|
<span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span>
|
@@ -1296,7 +1283,7 @@ certificate (call cert.public_key on that object).</p>
|
|
1296
1283
|
87</pre>
|
1297
1284
|
</td>
|
1298
1285
|
<td>
|
1299
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 85</span>
|
1286
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 85</span>
|
1300
1287
|
|
1301
1288
|
<span class='kw'>def</span> <span class='id identifier rubyid_to_pem'>to_pem</span>
|
1302
1289
|
<span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span>
|
@@ -1366,7 +1353,7 @@ certificate (call cert.public_key on that object)</p>
|
|
1366
1353
|
70</pre>
|
1367
1354
|
</td>
|
1368
1355
|
<td>
|
1369
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 68</span>
|
1356
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 68</span>
|
1370
1357
|
|
1371
1358
|
<span class='kw'>def</span> <span class='id identifier rubyid_verify'>verify</span><span class='lparen'>(</span><span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
|
1372
1359
|
<span class='ivar'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='lparen'>(</span><span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
|
@@ -1408,8 +1395,8 @@ certificate (call cert.public_key on that object)</p>
|
|
1408
1395
|
|
1409
1396
|
—
|
1410
1397
|
<div class='inline'>
|
1411
|
-
<p>Either a string of the path for the file that you
|
1412
|
-
IO-like object.</p>
|
1398
|
+
<p>Either a string of the path for the file that you'd like to write, or
|
1399
|
+
an IO-like object.</p>
|
1413
1400
|
</div>
|
1414
1401
|
|
1415
1402
|
</li>
|
@@ -1428,7 +1415,7 @@ IO-like object.</p>
|
|
1428
1415
|
48</pre>
|
1429
1416
|
</td>
|
1430
1417
|
<td>
|
1431
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 46</span>
|
1418
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 46</span>
|
1432
1419
|
|
1433
1420
|
<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>
|
1434
1421
|
<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'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span><span class='rparen'>)</span>
|
@@ -1470,8 +1457,8 @@ IO-like object.</p>
|
|
1470
1457
|
|
1471
1458
|
—
|
1472
1459
|
<div class='inline'>
|
1473
|
-
<p>Either a string of the path for the file that you
|
1474
|
-
IO-like object.</p>
|
1460
|
+
<p>Either a string of the path for the file that you'd like to write, or
|
1461
|
+
an IO-like object.</p>
|
1475
1462
|
</div>
|
1476
1463
|
|
1477
1464
|
</li>
|
@@ -1490,7 +1477,7 @@ IO-like object.</p>
|
|
1490
1477
|
40</pre>
|
1491
1478
|
</td>
|
1492
1479
|
<td>
|
1493
|
-
<pre class="code"><span class="info file"># File 'lib/r509/crl.rb', line 38</span>
|
1480
|
+
<pre class="code"><span class="info file"># File 'lib/r509/crl/signed_list.rb', line 38</span>
|
1494
1481
|
|
1495
1482
|
<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>
|
1496
1483
|
<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'>@crl</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span><span class='rparen'>)</span>
|
@@ -1505,9 +1492,9 @@ IO-like object.</p>
|
|
1505
1492
|
</div>
|
1506
1493
|
|
1507
1494
|
<div id="footer">
|
1508
|
-
Generated on
|
1495
|
+
Generated on Sun Jan 26 13:37:27 2014 by
|
1509
1496
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1510
|
-
0.8.
|
1497
|
+
0.8.6.1 (ruby-2.0.0).
|
1511
1498
|
</div>
|
1512
1499
|
|
1513
1500
|
</body>
|
data/doc/R509/CSR.html
CHANGED
@@ -6,13 +6,13 @@
|
|
6
6
|
<title>
|
7
7
|
Class: R509::CSR
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.
|
9
|
+
— Documentation by YARD 0.8.6.1
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
16
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
@@ -91,7 +91,7 @@
|
|
91
91
|
|
92
92
|
|
93
93
|
<dt class="r2">Includes:</dt>
|
94
|
-
<dd class="r2"><span class='object_link'><a href="
|
94
|
+
<dd class="r2"><span class='object_link'><a href="Helpers.html" title="R509::Helpers (module)">Helpers</a></span></dd>
|
95
95
|
|
96
96
|
|
97
97
|
|
@@ -344,12 +344,19 @@
|
|
344
344
|
<li class="public ">
|
345
345
|
<span class="summary_signature">
|
346
346
|
|
347
|
-
<a href="#
|
347
|
+
<a href="#bit_length-instance_method" title="#bit_length (instance method)">- (Integer) <strong>bit_length</strong> </a>
|
348
348
|
|
349
349
|
|
350
350
|
|
351
|
+
(also: #bit_strength)
|
352
|
+
|
351
353
|
</span>
|
352
354
|
|
355
|
+
<span class="note title not_defined_here">
|
356
|
+
included
|
357
|
+
from <span class='object_link'><a href="Helpers.html#bit_length-instance_method" title="R509::Helpers#bit_length (method)">Helpers</a></span>
|
358
|
+
</span>
|
359
|
+
|
353
360
|
|
354
361
|
|
355
362
|
|
@@ -359,7 +366,7 @@
|
|
359
366
|
|
360
367
|
|
361
368
|
<span class="summary_desc"><div class='inline'>
|
362
|
-
<p>Returns the bit
|
369
|
+
<p>Returns the bit length of the key.</p>
|
363
370
|
</div></span>
|
364
371
|
|
365
372
|
</li>
|
@@ -374,6 +381,11 @@
|
|
374
381
|
|
375
382
|
</span>
|
376
383
|
|
384
|
+
<span class="note title not_defined_here">
|
385
|
+
included
|
386
|
+
from <span class='object_link'><a href="Helpers.html#curve_name-instance_method" title="R509::Helpers#curve_name (method)">Helpers</a></span>
|
387
|
+
</span>
|
388
|
+
|
377
389
|
|
378
390
|
|
379
391
|
|
@@ -399,6 +411,11 @@ key if the key is EC.</p>
|
|
399
411
|
|
400
412
|
</span>
|
401
413
|
|
414
|
+
<span class="note title not_defined_here">
|
415
|
+
included
|
416
|
+
from <span class='object_link'><a href="Helpers.html#dsa%3F-instance_method" title="R509::Helpers#dsa? (method)">Helpers</a></span>
|
417
|
+
</span>
|
418
|
+
|
402
419
|
|
403
420
|
|
404
421
|
|
@@ -423,6 +440,11 @@ key if the key is EC.</p>
|
|
423
440
|
|
424
441
|
</span>
|
425
442
|
|
443
|
+
<span class="note title not_defined_here">
|
444
|
+
included
|
445
|
+
from <span class='object_link'><a href="Helpers.html#ec%3F-instance_method" title="R509::Helpers#ec? (method)">Helpers</a></span>
|
446
|
+
</span>
|
447
|
+
|
426
448
|
|
427
449
|
|
428
450
|
|
@@ -491,7 +513,7 @@ key if the key is EC.</p>
|
|
491
513
|
<li class="public ">
|
492
514
|
<span class="summary_signature">
|
493
515
|
|
494
|
-
<a href="#key_algorithm-instance_method" title="#key_algorithm (instance method)">- (
|
516
|
+
<a href="#key_algorithm-instance_method" title="#key_algorithm (instance method)">- (String) <strong>key_algorithm</strong> </a>
|
495
517
|
|
496
518
|
|
497
519
|
|
@@ -545,6 +567,11 @@ key if the key is EC.</p>
|
|
545
567
|
|
546
568
|
</span>
|
547
569
|
|
570
|
+
<span class="note title not_defined_here">
|
571
|
+
included
|
572
|
+
from <span class='object_link'><a href="Helpers.html#rsa%3F-instance_method" title="R509::Helpers#rsa? (method)">Helpers</a></span>
|
573
|
+
</span>
|
574
|
+
|
548
575
|
|
549
576
|
|
550
577
|
|
@@ -617,6 +644,11 @@ key if the key is EC.</p>
|
|
617
644
|
|
618
645
|
</span>
|
619
646
|
|
647
|
+
<span class="note title not_defined_here">
|
648
|
+
included
|
649
|
+
from <span class='object_link'><a href="Helpers.html#to_der-instance_method" title="R509::Helpers#to_der (method)">Helpers</a></span>
|
650
|
+
</span>
|
651
|
+
|
620
652
|
|
621
653
|
|
622
654
|
|
@@ -626,7 +658,7 @@ key if the key is EC.</p>
|
|
626
658
|
|
627
659
|
|
628
660
|
<span class="summary_desc"><div class='inline'>
|
629
|
-
<p>Converts the
|
661
|
+
<p>Converts the object into DER format.</p>
|
630
662
|
</div></span>
|
631
663
|
|
632
664
|
</li>
|
@@ -639,10 +671,13 @@ key if the key is EC.</p>
|
|
639
671
|
|
640
672
|
|
641
673
|
|
642
|
-
(also: #to_s)
|
643
|
-
|
644
674
|
</span>
|
645
675
|
|
676
|
+
<span class="note title not_defined_here">
|
677
|
+
included
|
678
|
+
from <span class='object_link'><a href="Helpers.html#to_pem-instance_method" title="R509::Helpers#to_pem (method)">Helpers</a></span>
|
679
|
+
</span>
|
680
|
+
|
646
681
|
|
647
682
|
|
648
683
|
|
@@ -652,7 +687,7 @@ key if the key is EC.</p>
|
|
652
687
|
|
653
688
|
|
654
689
|
<span class="summary_desc"><div class='inline'>
|
655
|
-
<p>Converts the
|
690
|
+
<p>Converts the object into PEM format.</p>
|
656
691
|
</div></span>
|
657
692
|
|
658
693
|
</li>
|
@@ -691,6 +726,11 @@ key if the key is EC.</p>
|
|
691
726
|
|
692
727
|
</span>
|
693
728
|
|
729
|
+
<span class="note title not_defined_here">
|
730
|
+
included
|
731
|
+
from <span class='object_link'><a href="Helpers.html#write_der-instance_method" title="R509::Helpers#write_der (method)">Helpers</a></span>
|
732
|
+
</span>
|
733
|
+
|
694
734
|
|
695
735
|
|
696
736
|
|
@@ -700,7 +740,7 @@ key if the key is EC.</p>
|
|
700
740
|
|
701
741
|
|
702
742
|
<span class="summary_desc"><div class='inline'>
|
703
|
-
<p>Writes the
|
743
|
+
<p>Writes the object into DER format.</p>
|
704
744
|
</div></span>
|
705
745
|
|
706
746
|
</li>
|
@@ -715,6 +755,11 @@ key if the key is EC.</p>
|
|
715
755
|
|
716
756
|
</span>
|
717
757
|
|
758
|
+
<span class="note title not_defined_here">
|
759
|
+
included
|
760
|
+
from <span class='object_link'><a href="Helpers.html#write_pem-instance_method" title="R509::Helpers#write_pem (method)">Helpers</a></span>
|
761
|
+
</span>
|
762
|
+
|
718
763
|
|
719
764
|
|
720
765
|
|
@@ -724,7 +769,7 @@ key if the key is EC.</p>
|
|
724
769
|
|
725
770
|
|
726
771
|
<span class="summary_desc"><div class='inline'>
|
727
|
-
<p>Writes the
|
772
|
+
<p>Writes the object into PEM format.</p>
|
728
773
|
</div></span>
|
729
774
|
|
730
775
|
</li>
|
@@ -737,14 +782,7 @@ key if the key is EC.</p>
|
|
737
782
|
|
738
783
|
|
739
784
|
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
<h3 class="inherited">Methods included from <span class='object_link'><a href="IOHelpers.html" title="R509::IOHelpers (module)">IOHelpers</a></span></h3>
|
746
|
-
<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>
|
747
|
-
<div id="constructor_details" class="method_details_list">
|
785
|
+
<div id="constructor_details" class="method_details_list">
|
748
786
|
<h2>Constructor Details</h2>
|
749
787
|
|
750
788
|
<div class="method_details first">
|
@@ -774,27 +812,36 @@ key if the key is EC.</p>
|
|
774
812
|
<p>Generate a 4096-bit RSA key + CSR</p>
|
775
813
|
</div></p>
|
776
814
|
|
777
|
-
<pre class="example code"><code>:type =>
|
778
|
-
:
|
815
|
+
<pre class="example code"><code>:type => "RSA",
|
816
|
+
:bit_length => 4096,
|
779
817
|
:subject => [
|
780
|
-
[
|
781
|
-
[
|
782
|
-
[
|
783
|
-
[
|
784
|
-
[
|
818
|
+
['CN','somedomain.com'],
|
819
|
+
['O','My Org'],
|
820
|
+
['L','City'],
|
821
|
+
['ST','State'],
|
822
|
+
['C','US']
|
785
823
|
]</code></pre>
|
786
824
|
|
787
825
|
|
826
|
+
<p class="example_title"><div class='inline'>
|
827
|
+
<p>Generate a 2048-bit RSA key + CSR</p>
|
828
|
+
</div></p>
|
829
|
+
|
830
|
+
<pre class="example code"><code>:type => "RSA",
|
831
|
+
:bit_length => 4096,
|
832
|
+
:subject => { :CN => "myCN", :O => "org" }</code></pre>
|
833
|
+
|
834
|
+
|
788
835
|
<p class="example_title"><div class='inline'>
|
789
836
|
<p>Generate an ECDSA key using the secp384r1 curve parameters + CSR and sign
|
790
837
|
with SHA512</p>
|
791
838
|
</div></p>
|
792
839
|
|
793
|
-
<pre class="example code"><code>:type =>
|
794
|
-
:curve_name =>
|
795
|
-
:message_digest =>
|
840
|
+
<pre class="example code"><code>:type => "EC",
|
841
|
+
:curve_name => 'secp384r1',
|
842
|
+
:message_digest => 'sha512',
|
796
843
|
:subject => [
|
797
|
-
[
|
844
|
+
['CN','somedomain.com'],
|
798
845
|
]</code></pre>
|
799
846
|
|
800
847
|
</div>
|
@@ -842,13 +889,14 @@ with SHA512</p>
|
|
842
889
|
|
843
890
|
<li>
|
844
891
|
<span class="name">:type</span>
|
845
|
-
<span class="type">(<tt>
|
892
|
+
<span class="type">(<tt>String</tt>)</span>
|
846
893
|
<span class="default">
|
847
894
|
|
848
895
|
</span>
|
849
896
|
|
850
897
|
— <div class='inline'>
|
851
|
-
<p
|
898
|
+
<p>Required if not providing existing :csr. Defaults to
|
899
|
+
R509::PrivateKey::DEFAULT_TYPE. Allows R509::PrivateKey::KNOWN_TYPES.</p>
|
852
900
|
</div>
|
853
901
|
|
854
902
|
</li>
|
@@ -864,7 +912,23 @@ with SHA512</p>
|
|
864
912
|
</span>
|
865
913
|
|
866
914
|
— <div class='inline'>
|
867
|
-
<p>Only used if :type is
|
915
|
+
<p>Only used if :type is EC</p>
|
916
|
+
</div>
|
917
|
+
|
918
|
+
</li>
|
919
|
+
|
920
|
+
<li>
|
921
|
+
<span class="name">:bit_length</span>
|
922
|
+
<span class="type">(<tt>Integer</tt>)</span>
|
923
|
+
<span class="default">
|
924
|
+
|
925
|
+
— default:
|
926
|
+
<tt>2048</tt>
|
927
|
+
|
928
|
+
</span>
|
929
|
+
|
930
|
+
— <div class='inline'>
|
931
|
+
<p>Only used if :type is RSA or DSA</p>
|
868
932
|
</div>
|
869
933
|
|
870
934
|
</li>
|
@@ -880,7 +944,7 @@ with SHA512</p>
|
|
880
944
|
</span>
|
881
945
|
|
882
946
|
— <div class='inline'>
|
883
|
-
<p>
|
947
|
+
<p>Deprecated, identical to bit_length.</p>
|
884
948
|
</div>
|
885
949
|
|
886
950
|
</li>
|
@@ -901,7 +965,7 @@ sha1</p>
|
|
901
965
|
|
902
966
|
<li>
|
903
967
|
<span class="name">:san_names</span>
|
904
|
-
<span class="type">(<tt>Array</tt>)</span>
|
968
|
+
<span class="type">(<tt>Array</tt>, <tt><span class='object_link'><a href="ASN1/GeneralNames.html" title="R509::ASN1::GeneralNames (class)">R509::ASN1::GeneralNames</a></span></tt>)</span>
|
905
969
|
<span class="default">
|
906
970
|
|
907
971
|
</span>
|
@@ -909,7 +973,9 @@ sha1</p>
|
|
909
973
|
— <div class='inline'>
|
910
974
|
<p>List of domains, IPs, email addresses, or URIs to encode as
|
911
975
|
subjectAltNames. The type is determined from the structure of the strings
|
912
|
-
via the R509::ASN1.general_name_parser method
|
976
|
+
via the R509::ASN1.general_name_parser method. You can also pass an
|
977
|
+
explicit R509::ASN1::GeneralNames object. Parsed names will be uniqued, but
|
978
|
+
a GeneralNames object will not be touched.</p>
|
913
979
|
</div>
|
914
980
|
|
915
981
|
</li>
|
@@ -952,13 +1018,6 @@ support)</p>
|
|
952
1018
|
<pre class="lines">
|
953
1019
|
|
954
1020
|
|
955
|
-
39
|
956
|
-
40
|
957
|
-
41
|
958
|
-
42
|
959
|
-
43
|
960
|
-
44
|
961
|
-
45
|
962
1021
|
46
|
963
1022
|
47
|
964
1023
|
48
|
@@ -1008,37 +1067,32 @@ support)</p>
|
|
1008
1067
|
92</pre>
|
1009
1068
|
</td>
|
1010
1069
|
<td>
|
1011
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1070
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 46</span>
|
1012
1071
|
|
1013
1072
|
<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>
|
1014
1073
|
<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>
|
1015
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'
|
1074
|
+
<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>
|
1016
1075
|
<span class='kw'>end</span>
|
1017
|
-
|
1076
|
+
<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'>:subject</span><span class='rparen'>)</span> <span class='kw'>and</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'>:csr</span><span class='rparen'>)</span>
|
1018
1077
|
<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'>You must provide :subject or :csr, not both</span><span class='tstring_end'>"</span></span>
|
1019
1078
|
<span class='kw'>end</span>
|
1020
|
-
<span class='ivar'>@
|
1021
|
-
<span class='ivar'>@curve_name</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:curve_name</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='
|
1022
|
-
|
1023
|
-
<span class='
|
1024
|
-
|
1025
|
-
<span class='ivar'>@key</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span>
|
1026
|
-
<span class='kw'>else</span>
|
1027
|
-
<span class='ivar'>@key</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>PrivateKey</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:key</span> <span class='op'>=></span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1028
|
-
<span class='kw'>end</span>
|
1029
|
-
<span class='kw'>end</span>
|
1079
|
+
<span class='ivar'>@bit_length</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:bit_length</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:bit_strength</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>PrivateKey</span><span class='op'>::</span><span class='const'>DEFAULT_STRENGTH</span>
|
1080
|
+
<span class='ivar'>@curve_name</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:curve_name</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>PrivateKey</span><span class='op'>::</span><span class='const'>DEFAULT_CURVE</span>
|
1081
|
+
|
1082
|
+
<span class='ivar'>@key</span> <span class='op'>=</span> <span class='id identifier rubyid_load_private_key'>load_private_key</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
1083
|
+
|
1030
1084
|
|
1031
|
-
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='
|
1032
|
-
<span class='kw'>if</span> <span class='kw'>not</span> <span class='
|
1033
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'
|
1085
|
+
<span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:type</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>PrivateKey</span><span class='op'>::</span><span class='const'>DEFAULT_TYPE</span>
|
1086
|
+
<span class='kw'>if</span> <span class='kw'>not</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>PrivateKey</span><span class='op'>::</span><span class='const'>KNOWN_TYPES</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='period'>.</span><span class='id identifier rubyid_upcase'>upcase</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='ivar'>@key</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1087
|
+
<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 </span><span class='embexpr_beg'>#{</span><span class='const'>R509</span><span class='op'>::</span><span class='const'>PrivateKey</span><span class='op'>::</span><span class='const'>KNOWN_TYPES</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>, </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'> as type when key is nil</span><span class='tstring_end'>"</span></span>
|
1034
1088
|
<span class='kw'>end</span>
|
1035
1089
|
|
1036
1090
|
<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'>:subject</span><span class='rparen'>)</span>
|
1037
|
-
<span class='id identifier rubyid_san_names'>san_names</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='period'>.</span><span class='id identifier rubyid_general_name_parser'>general_name_parser</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:san_names</span><span class='rbracket'>]</span
|
1091
|
+
<span class='id identifier rubyid_san_names'>san_names</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='period'>.</span><span class='id identifier rubyid_general_name_parser'>general_name_parser</span><span class='lparen'>(</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='rparen'>)</span>
|
1038
1092
|
<span class='id identifier rubyid_create_request'>create_request</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='comma'>,</span> <span class='id identifier rubyid_san_names'>san_names</span><span class='rparen'>)</span> <span class='comment'>#sets @req
|
1039
1093
|
</span> <span class='kw'>elsif</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'>:csr</span><span class='rparen'>)</span>
|
1040
1094
|
<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>
|
1041
|
-
<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'>You can
|
1095
|
+
<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'>You can't add domains to an existing CSR</span><span class='tstring_end'>"</span></span>
|
1042
1096
|
<span class='kw'>end</span>
|
1043
1097
|
<span class='id identifier rubyid_parse_csr'>parse_csr</span><span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1044
1098
|
<span class='kw'>else</span>
|
@@ -1047,20 +1101,18 @@ support)</p>
|
|
1047
1101
|
|
1048
1102
|
<span class='kw'>if</span> <span class='id identifier rubyid_dsa?'>dsa?</span>
|
1049
1103
|
<span class='comment'>#only DSS1 is acceptable for DSA signing in OpenSSL < 1.0
|
1050
|
-
</span> <span class='comment'>#post-1.0 you can sign with anything, but let
|
1104
|
+
</span> <span class='comment'>#post-1.0 you can sign with anything, but let's be conservative
|
1051
1105
|
</span> <span class='comment'>#see: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/PKey/DSA.html
|
1052
|
-
</span> <span class='ivar'>@message_digest</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>MessageDigest</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'
|
1053
|
-
<span class='kw'>elsif</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'>:message_digest</span><span class='rparen'>)</span>
|
1054
|
-
<span class='ivar'>@message_digest</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>MessageDigest</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'>:message_digest</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1106
|
+
</span> <span class='ivar'>@message_digest</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>MessageDigest</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>dss1</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1055
1107
|
<span class='kw'>else</span>
|
1056
|
-
<span class='ivar'>@message_digest</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>MessageDigest</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='
|
1108
|
+
<span class='ivar'>@message_digest</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>MessageDigest</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'>:message_digest</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1057
1109
|
<span class='kw'>end</span>
|
1058
1110
|
|
1059
1111
|
<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_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:csr</span><span class='rparen'>)</span>
|
1060
1112
|
<span class='ivar'>@req</span><span class='period'>.</span><span class='id identifier rubyid_sign'>sign</span><span class='lparen'>(</span><span class='ivar'>@key</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='ivar'>@message_digest</span><span class='period'>.</span><span class='id identifier rubyid_digest'>digest</span><span class='rparen'>)</span>
|
1061
1113
|
<span class='kw'>end</span>
|
1062
1114
|
<span class='kw'>if</span> <span class='kw'>not</span> <span class='ivar'>@key</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>and</span> <span class='kw'>not</span> <span class='ivar'>@req</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='lparen'>(</span><span class='ivar'>@key</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
1063
|
-
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'
|
1115
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Key does not match request.</span><span class='tstring_end'>'</span></span>
|
1064
1116
|
<span class='kw'>end</span>
|
1065
1117
|
|
1066
1118
|
<span class='kw'>end</span></pre>
|
@@ -1102,12 +1154,12 @@ support)</p>
|
|
1102
1154
|
<pre class="lines">
|
1103
1155
|
|
1104
1156
|
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1157
|
+
15
|
1158
|
+
16
|
1159
|
+
17</pre>
|
1108
1160
|
</td>
|
1109
1161
|
<td>
|
1110
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1162
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 15</span>
|
1111
1163
|
|
1112
1164
|
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
1113
1165
|
<span class='ivar'>@attributes</span>
|
@@ -1145,12 +1197,12 @@ support)</p>
|
|
1145
1197
|
<pre class="lines">
|
1146
1198
|
|
1147
1199
|
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1200
|
+
15
|
1201
|
+
16
|
1202
|
+
17</pre>
|
1151
1203
|
</td>
|
1152
1204
|
<td>
|
1153
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1205
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 15</span>
|
1154
1206
|
|
1155
1207
|
<span class='kw'>def</span> <span class='id identifier rubyid_key'>key</span>
|
1156
1208
|
<span class='ivar'>@key</span>
|
@@ -1188,12 +1240,12 @@ support)</p>
|
|
1188
1240
|
<pre class="lines">
|
1189
1241
|
|
1190
1242
|
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1243
|
+
15
|
1244
|
+
16
|
1245
|
+
17</pre>
|
1194
1246
|
</td>
|
1195
1247
|
<td>
|
1196
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1248
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 15</span>
|
1197
1249
|
|
1198
1250
|
<span class='kw'>def</span> <span class='id identifier rubyid_message_digest'>message_digest</span>
|
1199
1251
|
<span class='ivar'>@message_digest</span>
|
@@ -1231,12 +1283,12 @@ support)</p>
|
|
1231
1283
|
<pre class="lines">
|
1232
1284
|
|
1233
1285
|
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1286
|
+
15
|
1287
|
+
16
|
1288
|
+
17</pre>
|
1237
1289
|
</td>
|
1238
1290
|
<td>
|
1239
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1291
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 15</span>
|
1240
1292
|
|
1241
1293
|
<span class='kw'>def</span> <span class='id identifier rubyid_req'>req</span>
|
1242
1294
|
<span class='ivar'>@req</span>
|
@@ -1274,12 +1326,12 @@ support)</p>
|
|
1274
1326
|
<pre class="lines">
|
1275
1327
|
|
1276
1328
|
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1329
|
+
15
|
1330
|
+
16
|
1331
|
+
17</pre>
|
1280
1332
|
</td>
|
1281
1333
|
<td>
|
1282
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1334
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 15</span>
|
1283
1335
|
|
1284
1336
|
<span class='kw'>def</span> <span class='id identifier rubyid_san'>san</span>
|
1285
1337
|
<span class='ivar'>@san</span>
|
@@ -1317,12 +1369,12 @@ support)</p>
|
|
1317
1369
|
<pre class="lines">
|
1318
1370
|
|
1319
1371
|
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1372
|
+
15
|
1373
|
+
16
|
1374
|
+
17</pre>
|
1323
1375
|
</td>
|
1324
1376
|
<td>
|
1325
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1377
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 15</span>
|
1326
1378
|
|
1327
1379
|
<span class='kw'>def</span> <span class='id identifier rubyid_subject'>subject</span>
|
1328
1380
|
<span class='ivar'>@subject</span>
|
@@ -1425,18 +1477,27 @@ support)</p>
|
|
1425
1477
|
|
1426
1478
|
|
1427
1479
|
<div class="method_details first">
|
1428
|
-
<h3 class="signature first" id="
|
1480
|
+
<h3 class="signature first" id="bit_length-instance_method">
|
1429
1481
|
|
1430
|
-
- (<tt>Integer</tt>) <strong>
|
1482
|
+
- (<tt>Integer</tt>) <strong>bit_length</strong>
|
1431
1483
|
|
1432
1484
|
|
1433
1485
|
|
1486
|
+
<span class="aliases">Also known as:
|
1487
|
+
<span class="names"><span id='bit_strength-instance_method'>bit_strength</span></span>
|
1488
|
+
</span>
|
1489
|
+
|
1434
1490
|
|
1435
1491
|
|
1492
|
+
<span class="not_defined_here">
|
1493
|
+
Originally defined in module
|
1494
|
+
<span class='object_link'><a href="Helpers.html#bit_length-instance_method" title="R509::Helpers#bit_length (method)">Helpers</a></span>
|
1495
|
+
</span>
|
1496
|
+
|
1436
1497
|
</h3><div class="docstring">
|
1437
1498
|
<div class="discussion">
|
1438
1499
|
|
1439
|
-
<p>Returns the bit
|
1500
|
+
<p>Returns the bit length of the key</p>
|
1440
1501
|
|
1441
1502
|
|
1442
1503
|
</div>
|
@@ -1455,44 +1516,14 @@ support)</p>
|
|
1455
1516
|
|
1456
1517
|
—
|
1457
1518
|
<div class='inline'>
|
1458
|
-
<p>the integer bit
|
1519
|
+
<p>the integer bit length.</p>
|
1459
1520
|
</div>
|
1460
1521
|
|
1461
1522
|
</li>
|
1462
1523
|
|
1463
1524
|
</ul>
|
1464
1525
|
|
1465
|
-
</div
|
1466
|
-
<tr>
|
1467
|
-
<td>
|
1468
|
-
<pre class="lines">
|
1469
|
-
|
1470
|
-
|
1471
|
-
179
|
1472
|
-
180
|
1473
|
-
181
|
1474
|
-
182
|
1475
|
-
183
|
1476
|
-
184
|
1477
|
-
185
|
1478
|
-
186
|
1479
|
-
187</pre>
|
1480
|
-
</td>
|
1481
|
-
<td>
|
1482
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 179</span>
|
1483
|
-
|
1484
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_bit_strength'>bit_strength</span>
|
1485
|
-
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_rsa?'>rsa?</span>
|
1486
|
-
<span class='kw'>return</span> <span class='ivar'>@req</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>
|
1487
|
-
<span class='kw'>elsif</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_dsa?'>dsa?</span>
|
1488
|
-
<span class='kw'>return</span> <span class='ivar'>@req</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>
|
1489
|
-
<span class='kw'>elsif</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ec?'>ec?</span>
|
1490
|
-
<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'>'</span><span class='tstring_content'>Bit strength is not available for EC at this time.</span><span class='tstring_end'>'</span></span>
|
1491
|
-
<span class='kw'>end</span>
|
1492
|
-
<span class='kw'>end</span></pre>
|
1493
|
-
</td>
|
1494
|
-
</tr>
|
1495
|
-
</table>
|
1526
|
+
</div>
|
1496
1527
|
</div>
|
1497
1528
|
|
1498
1529
|
<div class="method_details ">
|
@@ -1504,6 +1535,11 @@ support)</p>
|
|
1504
1535
|
|
1505
1536
|
|
1506
1537
|
|
1538
|
+
<span class="not_defined_here">
|
1539
|
+
Originally defined in module
|
1540
|
+
<span class='object_link'><a href="Helpers.html#curve_name-instance_method" title="R509::Helpers#curve_name (method)">Helpers</a></span>
|
1541
|
+
</span>
|
1542
|
+
|
1507
1543
|
</h3><div class="docstring">
|
1508
1544
|
<div class="discussion">
|
1509
1545
|
|
@@ -1534,33 +1570,7 @@ key if the key is EC. If not, raises an error.</p>
|
|
1534
1570
|
|
1535
1571
|
</ul>
|
1536
1572
|
|
1537
|
-
</div
|
1538
|
-
<tr>
|
1539
|
-
<td>
|
1540
|
-
<pre class="lines">
|
1541
|
-
|
1542
|
-
|
1543
|
-
193
|
1544
|
-
194
|
1545
|
-
195
|
1546
|
-
196
|
1547
|
-
197
|
1548
|
-
198
|
1549
|
-
199</pre>
|
1550
|
-
</td>
|
1551
|
-
<td>
|
1552
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 193</span>
|
1553
|
-
|
1554
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_curve_name'>curve_name</span>
|
1555
|
-
<span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_ec?'>ec?</span>
|
1556
|
-
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='period'>.</span><span class='id identifier rubyid_group'>group</span><span class='period'>.</span><span class='id identifier rubyid_curve_name'>curve_name</span>
|
1557
|
-
<span class='kw'>else</span>
|
1558
|
-
<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'>'</span><span class='tstring_content'>Curve name is only available with EC CSRs</span><span class='tstring_end'>'</span></span>
|
1559
|
-
<span class='kw'>end</span>
|
1560
|
-
<span class='kw'>end</span></pre>
|
1561
|
-
</td>
|
1562
|
-
</tr>
|
1563
|
-
</table>
|
1573
|
+
</div>
|
1564
1574
|
</div>
|
1565
1575
|
|
1566
1576
|
<div class="method_details ">
|
@@ -1572,6 +1582,11 @@ key if the key is EC. If not, raises an error.</p>
|
|
1572
1582
|
|
1573
1583
|
|
1574
1584
|
|
1585
|
+
<span class="not_defined_here">
|
1586
|
+
Originally defined in module
|
1587
|
+
<span class='object_link'><a href="Helpers.html#dsa%3F-instance_method" title="R509::Helpers#dsa? (method)">Helpers</a></span>
|
1588
|
+
</span>
|
1589
|
+
|
1575
1590
|
</h3><div class="docstring">
|
1576
1591
|
<div class="discussion">
|
1577
1592
|
|
@@ -1601,25 +1616,7 @@ key if the key is EC. If not, raises an error.</p>
|
|
1601
1616
|
|
1602
1617
|
</ul>
|
1603
1618
|
|
1604
|
-
</div
|
1605
|
-
<tr>
|
1606
|
-
<td>
|
1607
|
-
<pre class="lines">
|
1608
|
-
|
1609
|
-
|
1610
|
-
166
|
1611
|
-
167
|
1612
|
-
168</pre>
|
1613
|
-
</td>
|
1614
|
-
<td>
|
1615
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 166</span>
|
1616
|
-
|
1617
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_dsa?'>dsa?</span>
|
1618
|
-
<span class='ivar'>@req</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>
|
1619
|
-
<span class='kw'>end</span></pre>
|
1620
|
-
</td>
|
1621
|
-
</tr>
|
1622
|
-
</table>
|
1619
|
+
</div>
|
1623
1620
|
</div>
|
1624
1621
|
|
1625
1622
|
<div class="method_details ">
|
@@ -1631,6 +1628,11 @@ key if the key is EC. If not, raises an error.</p>
|
|
1631
1628
|
|
1632
1629
|
|
1633
1630
|
|
1631
|
+
<span class="not_defined_here">
|
1632
|
+
Originally defined in module
|
1633
|
+
<span class='object_link'><a href="Helpers.html#ec%3F-instance_method" title="R509::Helpers#ec? (method)">Helpers</a></span>
|
1634
|
+
</span>
|
1635
|
+
|
1634
1636
|
</h3><div class="docstring">
|
1635
1637
|
<div class="discussion">
|
1636
1638
|
|
@@ -1660,25 +1662,7 @@ key if the key is EC. If not, raises an error.</p>
|
|
1660
1662
|
|
1661
1663
|
</ul>
|
1662
1664
|
|
1663
|
-
</div
|
1664
|
-
<tr>
|
1665
|
-
<td>
|
1666
|
-
<pre class="lines">
|
1667
|
-
|
1668
|
-
|
1669
|
-
173
|
1670
|
-
174
|
1671
|
-
175</pre>
|
1672
|
-
</td>
|
1673
|
-
<td>
|
1674
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 173</span>
|
1675
|
-
|
1676
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_ec?'>ec?</span>
|
1677
|
-
<span class='ivar'>@req</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'>EC</span><span class='rparen'>)</span>
|
1678
|
-
<span class='kw'>end</span></pre>
|
1679
|
-
</td>
|
1680
|
-
</tr>
|
1681
|
-
</table>
|
1665
|
+
</div>
|
1682
1666
|
</div>
|
1683
1667
|
|
1684
1668
|
<div class="method_details ">
|
@@ -1751,7 +1735,7 @@ key if the key is EC. If not, raises an error.</p>
|
|
1751
1735
|
<div class="method_details ">
|
1752
1736
|
<h3 class="signature " id="key_algorithm-instance_method">
|
1753
1737
|
|
1754
|
-
- (<tt>
|
1738
|
+
- (<tt>String</tt>) <strong>key_algorithm</strong>
|
1755
1739
|
|
1756
1740
|
|
1757
1741
|
|
@@ -1773,13 +1757,13 @@ key if the key is EC. If not, raises an error.</p>
|
|
1773
1757
|
<li>
|
1774
1758
|
|
1775
1759
|
|
1776
|
-
<span class='type'>(<tt>
|
1760
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1777
1761
|
|
1778
1762
|
|
1779
1763
|
|
1780
1764
|
—
|
1781
1765
|
<div class='inline'>
|
1782
|
-
<p>value of the key algorithm.
|
1766
|
+
<p>value of the key algorithm. RSA, DSA, or EC</p>
|
1783
1767
|
</div>
|
1784
1768
|
|
1785
1769
|
</li>
|
@@ -1792,26 +1776,26 @@ key if the key is EC. If not, raises an error.</p>
|
|
1792
1776
|
<pre class="lines">
|
1793
1777
|
|
1794
1778
|
|
1795
|
-
|
1796
|
-
|
1797
|
-
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1802
|
-
|
1803
|
-
|
1779
|
+
148
|
1780
|
+
149
|
1781
|
+
150
|
1782
|
+
151
|
1783
|
+
152
|
1784
|
+
153
|
1785
|
+
154
|
1786
|
+
155
|
1787
|
+
156</pre>
|
1804
1788
|
</td>
|
1805
1789
|
<td>
|
1806
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1790
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 148</span>
|
1807
1791
|
|
1808
1792
|
<span class='kw'>def</span> <span class='id identifier rubyid_key_algorithm'>key_algorithm</span>
|
1809
1793
|
<span class='kw'>if</span> <span class='ivar'>@req</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>
|
1810
|
-
<span class='
|
1794
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>RSA</span><span class='tstring_end'>"</span></span>
|
1811
1795
|
<span class='kw'>elsif</span> <span class='ivar'>@req</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>
|
1812
|
-
<span class='
|
1796
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DSA</span><span class='tstring_end'>"</span></span>
|
1813
1797
|
<span class='kw'>elsif</span> <span class='ivar'>@req</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'>EC</span> <span class='kw'>then</span>
|
1814
|
-
<span class='
|
1798
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>EC</span><span class='tstring_end'>"</span></span>
|
1815
1799
|
<span class='kw'>end</span>
|
1816
1800
|
<span class='kw'>end</span></pre>
|
1817
1801
|
</td>
|
@@ -1891,6 +1875,11 @@ key if the key is EC. If not, raises an error.</p>
|
|
1891
1875
|
|
1892
1876
|
|
1893
1877
|
|
1878
|
+
<span class="not_defined_here">
|
1879
|
+
Originally defined in module
|
1880
|
+
<span class='object_link'><a href="Helpers.html#rsa%3F-instance_method" title="R509::Helpers#rsa? (method)">Helpers</a></span>
|
1881
|
+
</span>
|
1882
|
+
|
1894
1883
|
</h3><div class="docstring">
|
1895
1884
|
<div class="discussion">
|
1896
1885
|
|
@@ -1920,25 +1909,7 @@ key if the key is EC. If not, raises an error.</p>
|
|
1920
1909
|
|
1921
1910
|
</ul>
|
1922
1911
|
|
1923
|
-
</div
|
1924
|
-
<tr>
|
1925
|
-
<td>
|
1926
|
-
<pre class="lines">
|
1927
|
-
|
1928
|
-
|
1929
|
-
159
|
1930
|
-
160
|
1931
|
-
161</pre>
|
1932
|
-
</td>
|
1933
|
-
<td>
|
1934
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 159</span>
|
1935
|
-
|
1936
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_rsa?'>rsa?</span>
|
1937
|
-
<span class='ivar'>@req</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>
|
1938
|
-
<span class='kw'>end</span></pre>
|
1939
|
-
</td>
|
1940
|
-
</tr>
|
1941
|
-
</table>
|
1912
|
+
</div>
|
1942
1913
|
</div>
|
1943
1914
|
|
1944
1915
|
<div class="method_details ">
|
@@ -1986,12 +1957,12 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
1986
1957
|
<pre class="lines">
|
1987
1958
|
|
1988
1959
|
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1960
|
+
141
|
1961
|
+
142
|
1962
|
+
143</pre>
|
1992
1963
|
</td>
|
1993
1964
|
<td>
|
1994
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
1965
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 141</span>
|
1995
1966
|
|
1996
1967
|
<span class='kw'>def</span> <span class='id identifier rubyid_signature_algorithm'>signature_algorithm</span>
|
1997
1968
|
<span class='ivar'>@req</span><span class='period'>.</span><span class='id identifier rubyid_signature_algorithm'>signature_algorithm</span>
|
@@ -2045,17 +2016,17 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2045
2016
|
<pre class="lines">
|
2046
2017
|
|
2047
2018
|
|
2048
|
-
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
|
2053
|
-
|
2054
|
-
|
2055
|
-
|
2019
|
+
129
|
2020
|
+
130
|
2021
|
+
131
|
2022
|
+
132
|
2023
|
+
133
|
2024
|
+
134
|
2025
|
+
135
|
2026
|
+
136</pre>
|
2056
2027
|
</td>
|
2057
2028
|
<td>
|
2058
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line
|
2029
|
+
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 129</span>
|
2059
2030
|
|
2060
2031
|
<span class='kw'>def</span> <span class='id identifier rubyid_subject_component'>subject_component</span> <span class='id identifier rubyid_short_name'>short_name</span>
|
2061
2032
|
<span class='ivar'>@req</span><span class='period'>.</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_element'>element</span><span class='op'>|</span>
|
@@ -2079,10 +2050,15 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2079
2050
|
|
2080
2051
|
|
2081
2052
|
|
2053
|
+
<span class="not_defined_here">
|
2054
|
+
Originally defined in module
|
2055
|
+
<span class='object_link'><a href="Helpers.html#to_der-instance_method" title="R509::Helpers#to_der (method)">Helpers</a></span>
|
2056
|
+
</span>
|
2057
|
+
|
2082
2058
|
</h3><div class="docstring">
|
2083
2059
|
<div class="discussion">
|
2084
2060
|
|
2085
|
-
<p>Converts the
|
2061
|
+
<p>Converts the object into DER format</p>
|
2086
2062
|
|
2087
2063
|
|
2088
2064
|
</div>
|
@@ -2101,32 +2077,14 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2101
2077
|
|
2102
2078
|
—
|
2103
2079
|
<div class='inline'>
|
2104
|
-
<p>the
|
2080
|
+
<p>the object converted into DER format.</p>
|
2105
2081
|
</div>
|
2106
2082
|
|
2107
2083
|
</li>
|
2108
2084
|
|
2109
2085
|
</ul>
|
2110
2086
|
|
2111
|
-
</div
|
2112
|
-
<tr>
|
2113
|
-
<td>
|
2114
|
-
<pre class="lines">
|
2115
|
-
|
2116
|
-
|
2117
|
-
136
|
2118
|
-
137
|
2119
|
-
138</pre>
|
2120
|
-
</td>
|
2121
|
-
<td>
|
2122
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 136</span>
|
2123
|
-
|
2124
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_der'>to_der</span>
|
2125
|
-
<span class='ivar'>@req</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span>
|
2126
|
-
<span class='kw'>end</span></pre>
|
2127
|
-
</td>
|
2128
|
-
</tr>
|
2129
|
-
</table>
|
2087
|
+
</div>
|
2130
2088
|
</div>
|
2131
2089
|
|
2132
2090
|
<div class="method_details ">
|
@@ -2136,16 +2094,17 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2136
2094
|
|
2137
2095
|
|
2138
2096
|
|
2139
|
-
<span class="aliases">Also known as:
|
2140
|
-
<span class="names"><span id='to_s-instance_method'>to_s</span></span>
|
2141
|
-
</span>
|
2142
|
-
|
2143
2097
|
|
2144
2098
|
|
2099
|
+
<span class="not_defined_here">
|
2100
|
+
Originally defined in module
|
2101
|
+
<span class='object_link'><a href="Helpers.html#to_pem-instance_method" title="R509::Helpers#to_pem (method)">Helpers</a></span>
|
2102
|
+
</span>
|
2103
|
+
|
2145
2104
|
</h3><div class="docstring">
|
2146
2105
|
<div class="discussion">
|
2147
2106
|
|
2148
|
-
<p>Converts the
|
2107
|
+
<p>Converts the object into PEM format</p>
|
2149
2108
|
|
2150
2109
|
|
2151
2110
|
</div>
|
@@ -2164,32 +2123,14 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2164
2123
|
|
2165
2124
|
—
|
2166
2125
|
<div class='inline'>
|
2167
|
-
<p>the
|
2126
|
+
<p>the object converted into PEM format.</p>
|
2168
2127
|
</div>
|
2169
2128
|
|
2170
2129
|
</li>
|
2171
2130
|
|
2172
2131
|
</ul>
|
2173
2132
|
|
2174
|
-
</div
|
2175
|
-
<tr>
|
2176
|
-
<td>
|
2177
|
-
<pre class="lines">
|
2178
|
-
|
2179
|
-
|
2180
|
-
127
|
2181
|
-
128
|
2182
|
-
129</pre>
|
2183
|
-
</td>
|
2184
|
-
<td>
|
2185
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 127</span>
|
2186
|
-
|
2187
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_to_pem'>to_pem</span>
|
2188
|
-
<span class='ivar'>@req</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span>
|
2189
|
-
<span class='kw'>end</span></pre>
|
2190
|
-
</td>
|
2191
|
-
</tr>
|
2192
|
-
</table>
|
2133
|
+
</div>
|
2193
2134
|
</div>
|
2194
2135
|
|
2195
2136
|
<div class="method_details ">
|
@@ -2255,10 +2196,15 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2255
2196
|
|
2256
2197
|
|
2257
2198
|
|
2199
|
+
<span class="not_defined_here">
|
2200
|
+
Originally defined in module
|
2201
|
+
<span class='object_link'><a href="Helpers.html#write_der-instance_method" title="R509::Helpers#write_der (method)">Helpers</a></span>
|
2202
|
+
</span>
|
2203
|
+
|
2258
2204
|
</h3><div class="docstring">
|
2259
2205
|
<div class="discussion">
|
2260
2206
|
|
2261
|
-
<p>Writes the
|
2207
|
+
<p>Writes the object into DER format</p>
|
2262
2208
|
|
2263
2209
|
|
2264
2210
|
</div>
|
@@ -2278,8 +2224,8 @@ sha256WithRSAEncryption, md5WithRSAEncryption</p>
|
|
2278
2224
|
|
2279
2225
|
—
|
2280
2226
|
<div class='inline'>
|
2281
|
-
<p>Either a string of the path for the file that you
|
2282
|
-
IO-like object.</p>
|
2227
|
+
<p>Either a string of the path for the file that you'd like to write, or
|
2228
|
+
an IO-like object.</p>
|
2283
2229
|
</div>
|
2284
2230
|
|
2285
2231
|
</li>
|
@@ -2287,25 +2233,7 @@ IO-like object.</p>
|
|
2287
2233
|
</ul>
|
2288
2234
|
|
2289
2235
|
|
2290
|
-
</div
|
2291
|
-
<tr>
|
2292
|
-
<td>
|
2293
|
-
<pre class="lines">
|
2294
|
-
|
2295
|
-
|
2296
|
-
152
|
2297
|
-
153
|
2298
|
-
154</pre>
|
2299
|
-
</td>
|
2300
|
-
<td>
|
2301
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 152</span>
|
2302
|
-
|
2303
|
-
<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>
|
2304
|
-
<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'>@req</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span><span class='rparen'>)</span>
|
2305
|
-
<span class='kw'>end</span></pre>
|
2306
|
-
</td>
|
2307
|
-
</tr>
|
2308
|
-
</table>
|
2236
|
+
</div>
|
2309
2237
|
</div>
|
2310
2238
|
|
2311
2239
|
<div class="method_details ">
|
@@ -2317,10 +2245,15 @@ IO-like object.</p>
|
|
2317
2245
|
|
2318
2246
|
|
2319
2247
|
|
2248
|
+
<span class="not_defined_here">
|
2249
|
+
Originally defined in module
|
2250
|
+
<span class='object_link'><a href="Helpers.html#write_pem-instance_method" title="R509::Helpers#write_pem (method)">Helpers</a></span>
|
2251
|
+
</span>
|
2252
|
+
|
2320
2253
|
</h3><div class="docstring">
|
2321
2254
|
<div class="discussion">
|
2322
2255
|
|
2323
|
-
<p>Writes the
|
2256
|
+
<p>Writes the object into PEM format</p>
|
2324
2257
|
|
2325
2258
|
|
2326
2259
|
</div>
|
@@ -2340,8 +2273,8 @@ IO-like object.</p>
|
|
2340
2273
|
|
2341
2274
|
—
|
2342
2275
|
<div class='inline'>
|
2343
|
-
<p>Either a string of the path for the file that you
|
2344
|
-
IO-like object.</p>
|
2276
|
+
<p>Either a string of the path for the file that you'd like to write, or
|
2277
|
+
an IO-like object.</p>
|
2345
2278
|
</div>
|
2346
2279
|
|
2347
2280
|
</li>
|
@@ -2349,25 +2282,7 @@ IO-like object.</p>
|
|
2349
2282
|
</ul>
|
2350
2283
|
|
2351
2284
|
|
2352
|
-
</div
|
2353
|
-
<tr>
|
2354
|
-
<td>
|
2355
|
-
<pre class="lines">
|
2356
|
-
|
2357
|
-
|
2358
|
-
144
|
2359
|
-
145
|
2360
|
-
146</pre>
|
2361
|
-
</td>
|
2362
|
-
<td>
|
2363
|
-
<pre class="code"><span class="info file"># File 'lib/r509/csr.rb', line 144</span>
|
2364
|
-
|
2365
|
-
<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>
|
2366
|
-
<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'>@req</span><span class='period'>.</span><span class='id identifier rubyid_to_pem'>to_pem</span><span class='rparen'>)</span>
|
2367
|
-
<span class='kw'>end</span></pre>
|
2368
|
-
</td>
|
2369
|
-
</tr>
|
2370
|
-
</table>
|
2285
|
+
</div>
|
2371
2286
|
</div>
|
2372
2287
|
|
2373
2288
|
</div>
|
@@ -2375,9 +2290,9 @@ IO-like object.</p>
|
|
2375
2290
|
</div>
|
2376
2291
|
|
2377
2292
|
<div id="footer">
|
2378
|
-
Generated on
|
2293
|
+
Generated on Sun Jan 26 13:37:26 2014 by
|
2379
2294
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2380
|
-
0.8.
|
2295
|
+
0.8.6.1 (ruby-2.0.0).
|
2381
2296
|
</div>
|
2382
2297
|
|
2383
2298
|
</body>
|