r509 0.10.0 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.mdown +2 -2
- data/Rakefile +2 -3
- data/bin/r509 +77 -80
- data/bin/r509-parse +4 -4
- data/doc/R509.html +60 -60
- data/doc/R509/ASN1.html +158 -48
- data/doc/R509/ASN1/GeneralName.html +157 -154
- data/doc/R509/ASN1/GeneralNames.html +246 -237
- data/doc/R509/CRL.html +41 -39
- data/doc/R509/CRL/Administrator.html +105 -100
- data/doc/R509/CRL/FileReaderWriter.html +146 -98
- data/doc/R509/CRL/ReaderWriter.html +57 -54
- data/doc/R509/CRL/SQLiteReaderWriter.html +727 -0
- data/doc/R509/CRL/SignedList.html +83 -80
- data/doc/R509/CSR.html +184 -162
- data/doc/R509/Cert.html +271 -269
- data/doc/R509/Cert/Extensions.html +62 -63
- data/doc/R509/Cert/Extensions/AuthorityInfoAccess.html +138 -108
- data/doc/R509/Cert/Extensions/AuthorityKeyIdentifier.html +100 -84
- data/doc/R509/Cert/Extensions/BasicConstraints.html +89 -88
- data/doc/R509/Cert/Extensions/CRLDistributionPoints.html +87 -83
- data/doc/R509/Cert/Extensions/CertificatePolicies.html +78 -76
- data/doc/R509/Cert/Extensions/ExtendedKeyUsage.html +128 -125
- data/doc/R509/Cert/Extensions/GeneralNamesMixin.html +83 -78
- data/doc/R509/Cert/Extensions/InhibitAnyPolicy.html +69 -67
- data/doc/R509/Cert/Extensions/KeyUsage.html +138 -135
- data/doc/R509/Cert/Extensions/NameConstraints.html +82 -81
- data/doc/R509/Cert/Extensions/NoticeReference.html +59 -56
- data/doc/R509/Cert/Extensions/OCSPNoCheck.html +70 -69
- data/doc/R509/Cert/Extensions/PolicyConstraints.html +71 -69
- data/doc/R509/Cert/Extensions/PolicyInformation.html +63 -60
- data/doc/R509/Cert/Extensions/PolicyQualifiers.html +60 -57
- data/doc/R509/Cert/Extensions/SubjectAlternativeName.html +91 -87
- data/doc/R509/Cert/Extensions/SubjectKeyIdentifier.html +72 -71
- data/doc/R509/Cert/Extensions/UserNotice.html +60 -57
- data/doc/R509/Cert/Extensions/ValidationMixin.html +43 -40
- data/doc/R509/CertificateAuthority.html +39 -37
- data/doc/R509/CertificateAuthority/OptionsBuilder.html +58 -55
- data/doc/R509/CertificateAuthority/Signer.html +277 -60
- data/doc/R509/Config.html +40 -38
- data/doc/R509/Config/CAConfig.html +255 -188
- data/doc/R509/Config/CAConfigPool.html +64 -61
- data/doc/R509/Config/CertProfile.html +119 -116
- data/doc/R509/Config/SubjectItemPolicy.html +94 -93
- data/doc/R509/Engine.html +60 -56
- data/doc/R509/Helpers.html +99 -96
- data/doc/R509/MessageDigest.html +69 -68
- data/doc/R509/NameSanitizer.html +51 -48
- data/doc/R509/OCSP.html +39 -37
- data/doc/R509/OCSP/Request.html +39 -37
- data/doc/R509/OCSP/Request/Nonce.html +67 -67
- data/doc/R509/OCSP/Response.html +93 -90
- data/doc/R509/OIDMapper.html +48 -46
- data/doc/R509/PrivateKey.html +170 -169
- data/doc/R509/R509Error.html +45 -42
- data/doc/R509/SPKI.html +99 -89
- data/doc/R509/Subject.html +86 -83
- data/doc/R509/Validity.html +57 -57
- data/doc/R509/Validity/Checker.html +63 -93
- data/doc/R509/Validity/DefaultChecker.html +58 -55
- data/doc/R509/Validity/DefaultWriter.html +62 -59
- data/doc/R509/Validity/Status.html +77 -74
- data/doc/R509/Validity/Writer.html +75 -123
- data/doc/_index.html +37 -31
- data/doc/class_list.html +25 -27
- data/doc/css/full_list.css +32 -31
- data/doc/css/style.css +221 -78
- data/doc/file.CONTRIBUTING.html +29 -30
- data/doc/file.LICENSE.html +29 -30
- data/doc/file.README.html +31 -32
- data/doc/file.YAML.html +33 -34
- data/doc/file.r509.html +39 -48
- data/doc/file_list.html +39 -30
- data/doc/frames.html +10 -21
- data/doc/index.html +31 -32
- data/doc/js/app.js +100 -71
- data/doc/js/full_list.js +168 -130
- data/doc/method_list.html +1788 -1119
- data/doc/top-level-namespace.html +45 -49
- data/lib/r509.rb +21 -7
- data/lib/r509/asn1.rb +45 -32
- data/lib/r509/cert.rb +45 -51
- data/lib/r509/cert/extensions/authority_info_access.rb +49 -23
- data/lib/r509/cert/extensions/authority_key_identifier.rb +16 -11
- data/lib/r509/cert/extensions/base.rb +22 -23
- data/lib/r509/cert/extensions/basic_constraints.rb +11 -12
- data/lib/r509/cert/extensions/certificate_policies.rb +26 -26
- data/lib/r509/cert/extensions/crl_distribution_points.rb +5 -7
- data/lib/r509/cert/extensions/extended_key_usage.rb +5 -5
- data/lib/r509/cert/extensions/inhibit_any_policy.rb +4 -3
- data/lib/r509/cert/extensions/key_usage.rb +5 -5
- data/lib/r509/cert/extensions/name_constraints.rb +16 -16
- data/lib/r509/cert/extensions/ocsp_no_check.rb +3 -3
- data/lib/r509/cert/extensions/policy_constraints.rb +8 -8
- data/lib/r509/cert/extensions/subject_alternative_name.rb +5 -4
- data/lib/r509/cert/extensions/subject_key_identifier.rb +5 -5
- data/lib/r509/cert/extensions/validation_mixin.rb +11 -10
- data/lib/r509/certificate_authority/options_builder.rb +19 -21
- data/lib/r509/certificate_authority/signer.rb +26 -27
- data/lib/r509/config.rb +1 -0
- data/lib/r509/config/ca_config.rb +70 -75
- data/lib/r509/config/cert_profile.rb +9 -8
- data/lib/r509/config/subject_item_policy.rb +25 -28
- data/lib/r509/crl/administrator.rb +19 -20
- data/lib/r509/crl/reader_writer.rb +10 -8
- data/lib/r509/crl/signed_list.rb +4 -4
- data/lib/r509/crl/sqlite_reader_writer.rb +75 -0
- data/lib/r509/csr.rb +54 -60
- data/lib/r509/ec-hack.rb +3 -2
- data/lib/r509/engine.rb +5 -6
- data/lib/r509/exceptions.rb +1 -1
- data/lib/r509/helpers.rb +11 -14
- data/lib/r509/io_helpers.rb +7 -7
- data/lib/r509/message_digest.rb +5 -6
- data/lib/r509/ocsp.rb +11 -13
- data/lib/r509/oid_mapper.rb +2 -2
- data/lib/r509/private_key.rb +28 -32
- data/lib/r509/spki.rb +17 -20
- data/lib/r509/subject.rb +26 -27
- data/lib/r509/trollop.rb +1 -0
- data/lib/r509/validity.rb +30 -21
- data/lib/r509/version.rb +4 -2
- data/r509.yaml +9 -17
- data/spec/asn1_spec.rb +145 -146
- data/spec/cert/extensions/authority_info_access_spec.rb +41 -41
- data/spec/cert/extensions/authority_key_identifier_spec.rb +29 -23
- data/spec/cert/extensions/base_spec.rb +38 -34
- data/spec/cert/extensions/basic_constraints_spec.rb +21 -21
- data/spec/cert/extensions/certificate_policies_spec.rb +99 -87
- data/spec/cert/extensions/crl_distribution_points_spec.rb +24 -25
- data/spec/cert/extensions/extended_key_usage_spec.rb +40 -36
- data/spec/cert/extensions/inhibit_any_policy_spec.rb +12 -12
- data/spec/cert/extensions/key_usage_spec.rb +44 -39
- data/spec/cert/extensions/name_constraints_spec.rb +83 -83
- data/spec/cert/extensions/ocsp_no_check_spec.rb +10 -10
- data/spec/cert/extensions/policy_constraints_spec.rb +19 -19
- data/spec/cert/extensions/subject_alternative_name_spec.rb +46 -47
- data/spec/cert/extensions/subject_key_identifier_spec.rb +10 -10
- data/spec/cert_spec.rb +105 -101
- data/spec/certificate_authority/options_builder_spec.rb +90 -90
- data/spec/certificate_authority/signer_spec.rb +41 -41
- data/spec/config/ca_config_spec.rb +169 -119
- data/spec/config/cert_profile_spec.rb +33 -33
- data/spec/config/subject_item_policy_spec.rb +22 -22
- data/spec/crl/administrator_spec.rb +65 -65
- data/spec/crl/reader_writer_spec.rb +20 -19
- data/spec/crl/signed_list_spec.rb +26 -26
- data/spec/crl/sqlite_reader_writer_spec.rb +42 -0
- data/spec/csr_spec.rb +149 -145
- data/spec/engine_spec.rb +14 -14
- data/spec/fixtures.rb +56 -39
- data/spec/fixtures/crl_list.sql +13 -0
- data/spec/fixtures/csr1.der +0 -0
- data/spec/fixtures/csr1.pem +6 -6
- data/spec/message_digest_spec.rb +43 -43
- data/spec/ocsp_spec.rb +25 -25
- data/spec/oid_mapper_spec.rb +18 -19
- data/spec/private_key_spec.rb +79 -81
- data/spec/r509_spec.rb +16 -16
- data/spec/spec_helper.rb +3 -3
- data/spec/spki_spec.rb +94 -94
- data/spec/subject_spec.rb +107 -107
- data/spec/validity_spec.rb +25 -25
- metadata +113 -111
- metadata.gz.sig +0 -0
@@ -1,12 +1,12 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
4
3
|
<head>
|
5
|
-
<meta
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
6
|
<title>
|
7
7
|
Class: R509::CertificateAuthority::OptionsBuilder
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.9.5
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -15,9 +15,8 @@
|
|
15
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
|
+
pathId = "R509::CertificateAuthority::OptionsBuilder";
|
19
19
|
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
20
|
</script>
|
22
21
|
|
23
22
|
|
@@ -28,51 +27,50 @@
|
|
28
27
|
|
29
28
|
</head>
|
30
29
|
<body>
|
31
|
-
<div
|
32
|
-
<
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
33
38
|
|
34
39
|
<a href="../../_index.html">Index (O)</a> »
|
35
40
|
<span class='title'><span class='object_link'><a href="../../R509.html" title="R509 (module)">R509</a></span></span> » <span class='title'><span class='object_link'><a href="../CertificateAuthority.html" title="R509::CertificateAuthority (module)">CertificateAuthority</a></span></span>
|
36
41
|
»
|
37
42
|
<span class="title">OptionsBuilder</span>
|
38
43
|
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
44
|
</div>
|
42
45
|
|
43
|
-
|
46
|
+
<div id="search">
|
44
47
|
|
45
48
|
<a class="full_list_link" id="class_list_link"
|
46
49
|
href="../../class_list.html">
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="../../file_list.html">
|
57
|
-
File List
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
58
56
|
</a>
|
59
57
|
|
60
58
|
</div>
|
61
|
-
|
62
|
-
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
63
61
|
|
64
|
-
|
62
|
+
<iframe id="search_frame" src="../../class_list.html"></iframe>
|
65
63
|
|
66
|
-
|
64
|
+
<div id="content"><h1>Class: R509::CertificateAuthority::OptionsBuilder
|
67
65
|
|
68
66
|
|
69
67
|
|
70
68
|
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
69
|
+
<div class="box_info">
|
73
70
|
|
74
|
-
|
75
|
-
<
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
76
74
|
<span class="inheritName">Object</span>
|
77
75
|
|
78
76
|
<ul class="fullTree">
|
@@ -83,21 +81,25 @@
|
|
83
81
|
</ul>
|
84
82
|
<a href="#" class="inheritanceTree">show all</a>
|
85
83
|
|
86
|
-
|
87
|
-
|
84
|
+
</dd>
|
85
|
+
</dl>
|
88
86
|
|
87
|
+
|
89
88
|
|
90
|
-
|
91
89
|
|
92
|
-
|
93
90
|
|
94
91
|
|
95
92
|
|
96
|
-
|
97
|
-
<dd class="r2 last">lib/r509/certificate_authority/options_builder.rb</dd>
|
93
|
+
|
98
94
|
|
99
|
-
|
100
|
-
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/r509/certificate_authority/options_builder.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
101
103
|
|
102
104
|
<h2>Overview</h2><div class="docstring">
|
103
105
|
<div class="discussion">
|
@@ -122,7 +124,7 @@ supplied to the #build_and_enforce method.</p>
|
|
122
124
|
|
123
125
|
<h2>
|
124
126
|
Instance Method Summary
|
125
|
-
<small
|
127
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
126
128
|
</h2>
|
127
129
|
|
128
130
|
<ul class="summary">
|
@@ -130,7 +132,7 @@ supplied to the #build_and_enforce method.</p>
|
|
130
132
|
<li class="public ">
|
131
133
|
<span class="summary_signature">
|
132
134
|
|
133
|
-
<a href="#build_and_enforce-instance_method" title="#build_and_enforce (instance method)"
|
135
|
+
<a href="#build_and_enforce-instance_method" title="#build_and_enforce (instance method)">#<strong>build_and_enforce</strong>(options) ⇒ Hash </a>
|
134
136
|
|
135
137
|
|
136
138
|
|
@@ -155,7 +157,7 @@ passed to the Signer.</p>
|
|
155
157
|
<li class="public ">
|
156
158
|
<span class="summary_signature">
|
157
159
|
|
158
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)"
|
160
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(config) ⇒ OptionsBuilder </a>
|
159
161
|
|
160
162
|
|
161
163
|
|
@@ -187,7 +189,7 @@ passed to the Signer.</p>
|
|
187
189
|
<div class="method_details first">
|
188
190
|
<h3 class="signature first" id="initialize-instance_method">
|
189
191
|
|
190
|
-
|
192
|
+
#<strong>initialize</strong>(config) ⇒ <tt><span class='object_link'><a href="" title="R509::CertificateAuthority::OptionsBuilder (class)">OptionsBuilder</a></span></tt>
|
191
193
|
|
192
194
|
|
193
195
|
|
@@ -196,7 +198,7 @@ passed to the Signer.</p>
|
|
196
198
|
</h3><div class="docstring">
|
197
199
|
<div class="discussion">
|
198
200
|
|
199
|
-
<p>
|
201
|
+
<p>Returns a new instance of OptionsBuilder</p>
|
200
202
|
|
201
203
|
|
202
204
|
</div>
|
@@ -221,7 +223,7 @@ passed to the Signer.</p>
|
|
221
223
|
<pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/options_builder.rb', line 4</span>
|
222
224
|
|
223
225
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
|
224
|
-
<span class='kw'>
|
226
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>R509</span><span class='op'>::</span><span class='const'>Config</span><span class='op'>::</span><span class='const'>CAConfig</span><span class='rparen'>)</span>
|
225
227
|
<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 supply a R509::Config::CAConfig object to this class at instantiation</span><span class='tstring_end'>"</span></span>
|
226
228
|
<span class='kw'>end</span>
|
227
229
|
<span class='ivar'>@config</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span>
|
@@ -241,7 +243,7 @@ passed to the Signer.</p>
|
|
241
243
|
<div class="method_details first">
|
242
244
|
<h3 class="signature first" id="build_and_enforce-instance_method">
|
243
245
|
|
244
|
-
|
246
|
+
#<strong>build_and_enforce</strong>(options) ⇒ <tt>Hash</tt>
|
245
247
|
|
246
248
|
|
247
249
|
|
@@ -250,8 +252,8 @@ passed to the Signer.</p>
|
|
250
252
|
</h3><div class="docstring">
|
251
253
|
<div class="discussion">
|
252
254
|
|
253
|
-
<p>Hash of :message_digest, :subject, :extensions, and :csr/:spki
|
254
|
-
passed to the Signer</p>
|
255
|
+
<p>Returns Hash of :message_digest, :subject, :extensions, and :csr/:spki
|
256
|
+
ready to be passed to the Signer</p>
|
255
257
|
|
256
258
|
|
257
259
|
</div>
|
@@ -441,15 +443,15 @@ passed to the Signer</p>
|
|
441
443
|
|
442
444
|
<span class='const'>R509</span><span class='op'>::</span><span class='const'>CertificateAuthority</span><span class='op'>::</span><span class='const'>Signer</span><span class='period'>.</span><span class='id identifier rubyid_check_options'>check_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
443
445
|
|
444
|
-
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier
|
445
|
-
<span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier
|
446
|
+
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:csr</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_verify_signature'>verify_signature</span><span class='rparen'>)</span> <span class='op'>||</span>
|
447
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:spki</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:spki</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_verify_signature'>verify_signature</span><span class='rparen'>)</span>
|
446
448
|
<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'>Request signature is invalid.</span><span class='tstring_end'>"</span></span>
|
447
449
|
<span class='kw'>end</span>
|
448
450
|
|
449
451
|
<span class='id identifier rubyid_raw_subject'>raw_subject</span><span class='comma'>,</span> <span class='id identifier rubyid_public_key'>public_key</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>CertificateAuthority</span><span class='op'>::</span><span class='const'>Signer</span><span class='period'>.</span><span class='id identifier rubyid_extract_public_key_subject'>extract_public_key_subject</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
450
452
|
|
451
|
-
<span class='id identifier rubyid_message_digest'>message_digest</span> <span class='op'>=</span> <span class='id identifier rubyid_enforce_md'>enforce_md</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:message_digest</span><span class='rbracket'>]</span><span class='comma'>,</span
|
452
|
-
<span class='id identifier rubyid_subject'>subject</span> <span class='op'>=</span> <span class='id identifier rubyid_enforce_subject_item_policy'>enforce_subject_item_policy</span><span class='lparen'>(</span><span class='id identifier rubyid_raw_subject'>raw_subject</span><span class='comma'>,</span
|
453
|
+
<span class='id identifier rubyid_message_digest'>message_digest</span> <span class='op'>=</span> <span class='id identifier rubyid_enforce_md'>enforce_md</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:message_digest</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_profile'>profile</span><span class='rparen'>)</span>
|
454
|
+
<span class='id identifier rubyid_subject'>subject</span> <span class='op'>=</span> <span class='id identifier rubyid_enforce_subject_item_policy'>enforce_subject_item_policy</span><span class='lparen'>(</span><span class='id identifier rubyid_raw_subject'>raw_subject</span><span class='comma'>,</span> <span class='id identifier rubyid_profile'>profile</span><span class='rparen'>)</span>
|
453
455
|
<span class='id identifier rubyid_enforce_not_after'>enforce_not_after</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:not_after</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
454
456
|
|
455
457
|
<span class='id identifier rubyid_extensions'>extensions</span> <span class='op'>=</span> <span class='id identifier rubyid_build_and_merge_extensions'>build_and_merge_extensions</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='id identifier rubyid_profile'>profile</span><span class='comma'>,</span> <span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
|
@@ -465,11 +467,12 @@ passed to the Signer</p>
|
|
465
467
|
|
466
468
|
</div>
|
467
469
|
|
468
|
-
|
469
|
-
Generated on
|
470
|
+
<div id="footer">
|
471
|
+
Generated on Tue Dec 6 17:27:42 2016 by
|
470
472
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
471
|
-
0.
|
473
|
+
0.9.5 (ruby-2.4.0).
|
472
474
|
</div>
|
473
475
|
|
476
|
+
</div>
|
474
477
|
</body>
|
475
478
|
</html>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<!DOCTYPE html
|
2
|
-
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
4
3
|
<head>
|
5
|
-
<meta
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
6
|
<title>
|
7
7
|
Class: R509::CertificateAuthority::Signer
|
8
8
|
|
9
|
-
— Documentation by YARD 0.
|
9
|
+
— Documentation by YARD 0.9.5
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -15,9 +15,8 @@
|
|
15
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
|
+
pathId = "R509::CertificateAuthority::Signer";
|
19
19
|
relpath = '../../';
|
20
|
-
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
20
|
</script>
|
22
21
|
|
23
22
|
|
@@ -28,51 +27,50 @@
|
|
28
27
|
|
29
28
|
</head>
|
30
29
|
<body>
|
31
|
-
<div
|
32
|
-
<
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
33
38
|
|
34
39
|
<a href="../../_index.html">Index (S)</a> »
|
35
40
|
<span class='title'><span class='object_link'><a href="../../R509.html" title="R509 (module)">R509</a></span></span> » <span class='title'><span class='object_link'><a href="../CertificateAuthority.html" title="R509::CertificateAuthority (module)">CertificateAuthority</a></span></span>
|
36
41
|
»
|
37
42
|
<span class="title">Signer</span>
|
38
43
|
|
39
|
-
|
40
|
-
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
44
|
</div>
|
42
45
|
|
43
|
-
|
46
|
+
<div id="search">
|
44
47
|
|
45
48
|
<a class="full_list_link" id="class_list_link"
|
46
49
|
href="../../class_list.html">
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
</a>
|
54
|
-
|
55
|
-
<a class="full_list_link" id="file_list_link"
|
56
|
-
href="../../file_list.html">
|
57
|
-
File List
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
58
56
|
</a>
|
59
57
|
|
60
58
|
</div>
|
61
|
-
|
62
|
-
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
63
61
|
|
64
|
-
|
62
|
+
<iframe id="search_frame" src="../../class_list.html"></iframe>
|
65
63
|
|
66
|
-
|
64
|
+
<div id="content"><h1>Class: R509::CertificateAuthority::Signer
|
67
65
|
|
68
66
|
|
69
67
|
|
70
68
|
</h1>
|
71
|
-
|
72
|
-
<dl class="box">
|
69
|
+
<div class="box_info">
|
73
70
|
|
74
|
-
|
75
|
-
<
|
71
|
+
<dl>
|
72
|
+
<dt>Inherits:</dt>
|
73
|
+
<dd>
|
76
74
|
<span class="inheritName">Object</span>
|
77
75
|
|
78
76
|
<ul class="fullTree">
|
@@ -83,21 +81,25 @@
|
|
83
81
|
</ul>
|
84
82
|
<a href="#" class="inheritanceTree">show all</a>
|
85
83
|
|
86
|
-
|
87
|
-
|
84
|
+
</dd>
|
85
|
+
</dl>
|
88
86
|
|
87
|
+
|
89
88
|
|
90
|
-
|
91
89
|
|
92
|
-
|
93
90
|
|
94
91
|
|
95
92
|
|
96
|
-
|
97
|
-
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/r509/certificate_authority/signer.rb</dd>
|
100
|
+
</dl>
|
98
101
|
|
99
|
-
</
|
100
|
-
<div class="clear"></div>
|
102
|
+
</div>
|
101
103
|
|
102
104
|
<h2>Overview</h2><div class="docstring">
|
103
105
|
<div class="discussion">
|
@@ -120,7 +122,7 @@
|
|
120
122
|
|
121
123
|
<h2>
|
122
124
|
Class Method Summary
|
123
|
-
<small
|
125
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
124
126
|
</h2>
|
125
127
|
|
126
128
|
<ul class="summary">
|
@@ -128,7 +130,73 @@
|
|
128
130
|
<li class="public ">
|
129
131
|
<span class="summary_signature">
|
130
132
|
|
131
|
-
<a href="#
|
133
|
+
<a href="#build_cert-class_method" title="build_cert (class method)">.<strong>build_cert</strong>(options) ⇒ Object </a>
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#check_options-class_method" title="check_options (class method)">.<strong>check_options</strong>(options) ⇒ Object </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
170
|
+
|
171
|
+
</li>
|
172
|
+
|
173
|
+
|
174
|
+
<li class="public ">
|
175
|
+
<span class="summary_signature">
|
176
|
+
|
177
|
+
<a href="#extract_public_key_subject-class_method" title="extract_public_key_subject (class method)">.<strong>extract_public_key_subject</strong>(options) ⇒ Object </a>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
</span>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
192
|
+
|
193
|
+
</li>
|
194
|
+
|
195
|
+
|
196
|
+
<li class="public ">
|
197
|
+
<span class="summary_signature">
|
198
|
+
|
199
|
+
<a href="#selfsign-class_method" title="selfsign (class method)">.<strong>selfsign</strong>(options) ⇒ R509::Cert </a>
|
132
200
|
|
133
201
|
|
134
202
|
|
@@ -153,7 +221,7 @@
|
|
153
221
|
|
154
222
|
<h2>
|
155
223
|
Instance Method Summary
|
156
|
-
<small
|
224
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
157
225
|
</h2>
|
158
226
|
|
159
227
|
<ul class="summary">
|
@@ -161,7 +229,7 @@
|
|
161
229
|
<li class="public ">
|
162
230
|
<span class="summary_signature">
|
163
231
|
|
164
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)"
|
232
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(config) ⇒ Signer </a>
|
165
233
|
|
166
234
|
|
167
235
|
|
@@ -187,7 +255,7 @@
|
|
187
255
|
<li class="public ">
|
188
256
|
<span class="summary_signature">
|
189
257
|
|
190
|
-
<a href="#sign-instance_method" title="#sign (instance method)"
|
258
|
+
<a href="#sign-instance_method" title="#sign (instance method)">#<strong>sign</strong>(options) ⇒ R509::Cert </a>
|
191
259
|
|
192
260
|
|
193
261
|
|
@@ -217,7 +285,7 @@
|
|
217
285
|
<div class="method_details first">
|
218
286
|
<h3 class="signature first" id="initialize-instance_method">
|
219
287
|
|
220
|
-
|
288
|
+
#<strong>initialize</strong>(config) ⇒ <tt><span class='object_link'><a href="" title="R509::CertificateAuthority::Signer (class)">Signer</a></span></tt>
|
221
289
|
|
222
290
|
|
223
291
|
|
@@ -226,7 +294,7 @@
|
|
226
294
|
</h3><div class="docstring">
|
227
295
|
<div class="discussion">
|
228
296
|
|
229
|
-
<p>
|
297
|
+
<p>Returns a new instance of Signer</p>
|
230
298
|
|
231
299
|
|
232
300
|
</div>
|
@@ -272,10 +340,10 @@
|
|
272
340
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
|
273
341
|
<span class='ivar'>@config</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span>
|
274
342
|
|
275
|
-
<span class='kw'>if</span> <span class='
|
343
|
+
<span class='kw'>if</span> <span class='ivar'>@config</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>R509</span><span class='op'>::</span><span class='const'>Config</span><span class='op'>::</span><span class='const'>CAConfig</span><span class='rparen'>)</span>
|
276
344
|
<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'>config must be a kind of R509::Config::CAConfig</span><span class='tstring_end'>"</span></span>
|
277
345
|
<span class='kw'>end</span>
|
278
|
-
<span class='kw'>if</span> <span class='
|
346
|
+
<span class='kw'>if</span> <span class='ivar'>@config</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_ca_cert'>ca_cert</span><span class='period'>.</span><span class='id identifier rubyid_has_private_key?'>has_private_key?</span>
|
279
347
|
<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'>You must have a private key associated with your CA certificate to issue</span><span class='tstring_end'>"</span></span>
|
280
348
|
<span class='kw'>end</span>
|
281
349
|
<span class='kw'>end</span></pre>
|
@@ -292,9 +360,157 @@
|
|
292
360
|
|
293
361
|
|
294
362
|
<div class="method_details first">
|
295
|
-
<h3 class="signature first" id="
|
363
|
+
<h3 class="signature first" id="build_cert-class_method">
|
364
|
+
|
365
|
+
.<strong>build_cert</strong>(options) ⇒ <tt>Object</tt>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
</h3><table class="source_code">
|
372
|
+
<tr>
|
373
|
+
<td>
|
374
|
+
<pre class="lines">
|
375
|
+
|
376
|
+
|
377
|
+
119
|
378
|
+
120
|
379
|
+
121
|
380
|
+
122
|
381
|
+
123
|
382
|
+
124
|
383
|
+
125
|
384
|
+
126
|
385
|
+
127
|
386
|
+
128
|
387
|
+
129
|
388
|
+
130</pre>
|
389
|
+
</td>
|
390
|
+
<td>
|
391
|
+
<pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 119</span>
|
392
|
+
|
393
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_build_cert'>build_cert</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
394
|
+
<span class='id identifier rubyid_cert'>cert</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'>Certificate</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
395
|
+
|
396
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_subject'>subject</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:subject</span><span class='rbracket'>]</span>
|
397
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_issuer'>issuer</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:issuer</span><span class='rbracket'>]</span>
|
398
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_not_before'>not_before</span> <span class='op'>=</span> <span class='id identifier rubyid_calculate_not_before'>calculate_not_before</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:not_before</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
399
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_not_after'>not_after</span> <span class='op'>=</span> <span class='id identifier rubyid_calculate_not_after'>calculate_not_after</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:not_after</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_not_before'>not_before</span><span class='rparen'>)</span>
|
400
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:public_key</span><span class='rbracket'>]</span>
|
401
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_serial'>serial</span> <span class='op'>=</span> <span class='id identifier rubyid_create_serial'>create_serial</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:serial</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
402
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='int'>2</span> <span class='comment'># 2 means v3
|
403
|
+
</span> <span class='id identifier rubyid_cert'>cert</span>
|
404
|
+
<span class='kw'>end</span></pre>
|
405
|
+
</td>
|
406
|
+
</tr>
|
407
|
+
</table>
|
408
|
+
</div>
|
409
|
+
|
410
|
+
<div class="method_details ">
|
411
|
+
<h3 class="signature " id="check_options-class_method">
|
296
412
|
|
297
|
-
|
413
|
+
.<strong>check_options</strong>(options) ⇒ <tt>Object</tt>
|
414
|
+
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
|
419
|
+
</h3><table class="source_code">
|
420
|
+
<tr>
|
421
|
+
<td>
|
422
|
+
<pre class="lines">
|
423
|
+
|
424
|
+
|
425
|
+
107
|
426
|
+
108
|
427
|
+
109
|
428
|
+
110
|
429
|
+
111
|
430
|
+
112
|
431
|
+
113
|
432
|
+
114
|
433
|
+
115
|
434
|
+
116
|
435
|
+
117</pre>
|
436
|
+
</td>
|
437
|
+
<td>
|
438
|
+
<pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 107</span>
|
439
|
+
|
440
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_check_options'>check_options</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
441
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:csr</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:spki</span><span class='rparen'>)</span>
|
442
|
+
<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 pass both :csr and :spki</span><span class='tstring_end'>"</span></span>
|
443
|
+
<span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:csr</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:spki</span><span class='rparen'>)</span>
|
444
|
+
<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 supply either :csr or :spki</span><span class='tstring_end'>"</span></span>
|
445
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:csr</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>R509</span><span class='op'>::</span><span class='const'>CSR</span><span class='rparen'>)</span>
|
446
|
+
<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 pass an R509::CSR object for :csr</span><span class='tstring_end'>"</span></span>
|
447
|
+
<span class='kw'>elsif</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:spki</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:spki</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>R509</span><span class='op'>::</span><span class='const'>SPKI</span><span class='rparen'>)</span>
|
448
|
+
<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 pass an R509::SPKI object for :spki</span><span class='tstring_end'>"</span></span>
|
449
|
+
<span class='kw'>end</span>
|
450
|
+
<span class='kw'>end</span></pre>
|
451
|
+
</td>
|
452
|
+
</tr>
|
453
|
+
</table>
|
454
|
+
</div>
|
455
|
+
|
456
|
+
<div class="method_details ">
|
457
|
+
<h3 class="signature " id="extract_public_key_subject-class_method">
|
458
|
+
|
459
|
+
.<strong>extract_public_key_subject</strong>(options) ⇒ <tt>Object</tt>
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
|
464
|
+
|
465
|
+
</h3><table class="source_code">
|
466
|
+
<tr>
|
467
|
+
<td>
|
468
|
+
<pre class="lines">
|
469
|
+
|
470
|
+
|
471
|
+
172
|
472
|
+
173
|
473
|
+
174
|
474
|
+
175
|
475
|
+
176
|
476
|
+
177
|
477
|
+
178
|
478
|
+
179
|
479
|
+
180
|
480
|
+
181
|
481
|
+
182
|
482
|
+
183
|
483
|
+
184
|
484
|
+
185
|
485
|
+
186</pre>
|
486
|
+
</td>
|
487
|
+
<td>
|
488
|
+
<pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 172</span>
|
489
|
+
|
490
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_extract_public_key_subject'>extract_public_key_subject</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
491
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:csr</span><span class='rparen'>)</span>
|
492
|
+
<span class='id identifier rubyid_subject'>subject</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:subject</span><span class='rparen'>)</span><span class='rparen'>)</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_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:subject</span><span class='rbracket'>]</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_subject'>subject</span>
|
493
|
+
<span class='id identifier rubyid_public_key'>public_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span>
|
494
|
+
<span class='kw'>else</span>
|
495
|
+
<span class='comment'># spki
|
496
|
+
</span> <span class='kw'>unless</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:subject</span><span class='rparen'>)</span>
|
497
|
+
<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 supply :subject when passing :spki</span><span class='tstring_end'>"</span></span>
|
498
|
+
<span class='kw'>end</span>
|
499
|
+
<span class='id identifier rubyid_public_key'>public_key</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:spki</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span>
|
500
|
+
<span class='id identifier rubyid_subject'>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_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:subject</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
501
|
+
<span class='kw'>end</span>
|
502
|
+
|
503
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_subject'>subject</span><span class='comma'>,</span> <span class='id identifier rubyid_public_key'>public_key</span><span class='rbracket'>]</span>
|
504
|
+
<span class='kw'>end</span></pre>
|
505
|
+
</td>
|
506
|
+
</tr>
|
507
|
+
</table>
|
508
|
+
</div>
|
509
|
+
|
510
|
+
<div class="method_details ">
|
511
|
+
<h3 class="signature " id="selfsign-class_method">
|
512
|
+
|
513
|
+
.<strong>selfsign</strong>(options) ⇒ <tt><span class='object_link'><a href="../Cert.html" title="R509::Cert (class)">R509::Cert</a></span></tt>
|
298
514
|
|
299
515
|
|
300
516
|
|
@@ -490,7 +706,7 @@ you want to embed in the final certificate</p>
|
|
490
706
|
<pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 70</span>
|
491
707
|
|
492
708
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_selfsign'>selfsign</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
493
|
-
<span class='kw'>
|
709
|
+
<span class='kw'>unless</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
494
710
|
<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 pass a hash of options consisting of at minimum :csr</span><span class='tstring_end'>"</span></span>
|
495
711
|
<span class='kw'>end</span>
|
496
712
|
<span class='id identifier rubyid_csr'>csr</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span>
|
@@ -515,13 +731,13 @@ you want to embed in the final certificate</p>
|
|
515
731
|
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Cert</span><span class='op'>::</span><span class='const'>Extensions</span><span class='op'>::</span><span class='const'>AuthorityKeyIdentifier</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:public_key</span> <span class='op'>=></span> <span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
|
516
732
|
<span class='rbracket'>]</span>
|
517
733
|
|
518
|
-
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier
|
734
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_key?'>key?</span><span class='lparen'>(</span><span class='symbol'>:message_digest</span><span class='rparen'>)</span>
|
519
735
|
<span class='id identifier rubyid_message_digest'>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_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:message_digest</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
520
736
|
<span class='kw'>else</span>
|
521
737
|
<span class='id identifier rubyid_message_digest'>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='const'>R509</span><span class='op'>::</span><span class='const'>MessageDigest</span><span class='op'>::</span><span class='const'>DEFAULT_MD</span><span class='rparen'>)</span>
|
522
738
|
<span class='kw'>end</span>
|
523
739
|
|
524
|
-
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_sign'>sign</span><span class='lparen'>(</span
|
740
|
+
<span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_sign'>sign</span><span class='lparen'>(</span><span class='id identifier rubyid_csr'>csr</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_message_digest'>message_digest</span><span class='period'>.</span><span class='id identifier rubyid_digest'>digest</span><span class='rparen'>)</span>
|
525
741
|
|
526
742
|
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Cert</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:cert</span> <span class='op'>=></span> <span class='id identifier rubyid_cert'>cert</span><span class='comma'>,</span> <span class='symbol'>:key</span> <span class='op'>=></span> <span class='id identifier rubyid_csr'>csr</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
527
743
|
<span class='kw'>end</span></pre>
|
@@ -539,7 +755,7 @@ you want to embed in the final certificate</p>
|
|
539
755
|
<div class="method_details first">
|
540
756
|
<h3 class="signature first" id="sign-instance_method">
|
541
757
|
|
542
|
-
|
758
|
+
#<strong>sign</strong>(options) ⇒ <tt><span class='object_link'><a href="../Cert.html" title="R509::Cert (class)">R509::Cert</a></span></tt>
|
543
759
|
|
544
760
|
|
545
761
|
|
@@ -769,11 +985,11 @@ you want to embed in the final certificate</p>
|
|
769
985
|
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Cert</span><span class='op'>::</span><span class='const'>Extensions</span><span class='op'>::</span><span class='const'>AuthorityKeyIdentifier</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:public_key</span> <span class='op'>=></span> <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_ca_cert'>ca_cert</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span>
|
770
986
|
<span class='rbracket'>]</span>
|
771
987
|
|
772
|
-
<span class='comment'
|
988
|
+
<span class='comment'># @config.ca_cert.key.key ... ugly. ca_cert returns R509::Cert
|
773
989
|
</span> <span class='comment'># #key returns R509::PrivateKey and #key on that returns OpenSSL object we need
|
774
|
-
</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_sign'>sign</span><span class='lparen'>(</span
|
990
|
+
</span> <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_sign'>sign</span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_ca_cert'>ca_cert</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_message_digest'>message_digest</span><span class='period'>.</span><span class='id identifier rubyid_digest'>digest</span><span class='rparen'>)</span>
|
775
991
|
<span class='id identifier rubyid_cert_opts'>cert_opts</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:cert</span> <span class='op'>=></span> <span class='id identifier rubyid_cert'>cert</span> <span class='rbrace'>}</span>
|
776
|
-
<span class='id identifier rubyid_cert_opts'>cert_opts</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='kw'>if</span> <span class='
|
992
|
+
<span class='id identifier rubyid_cert_opts'>cert_opts</span><span class='lbracket'>[</span><span class='symbol'>:key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span> <span class='op'>&&</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:csr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_key'>key</span>
|
777
993
|
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Cert</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_cert_opts'>cert_opts</span><span class='rparen'>)</span>
|
778
994
|
<span class='kw'>end</span></pre>
|
779
995
|
</td>
|
@@ -785,11 +1001,12 @@ you want to embed in the final certificate</p>
|
|
785
1001
|
|
786
1002
|
</div>
|
787
1003
|
|
788
|
-
|
789
|
-
Generated on
|
1004
|
+
<div id="footer">
|
1005
|
+
Generated on Tue Dec 6 17:27:41 2016 by
|
790
1006
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
791
|
-
0.
|
1007
|
+
0.9.5 (ruby-2.4.0).
|
792
1008
|
</div>
|
793
1009
|
|
1010
|
+
</div>
|
794
1011
|
</body>
|
795
1012
|
</html>
|