doc/R509/CertificateAuthority/Signer.html in r509-0.10.0 vs doc/R509/CertificateAuthority/Signer.html in r509-1.0

- old
+ new

@@ -1,106 +1,108 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<!DOCTYPE html> +<html> <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1.0"> <title> Class: R509::CertificateAuthority::Signer - &mdash; Documentation by YARD 0.8.6.1 + &mdash; Documentation by YARD 0.9.5 </title> <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" /> <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" /> <script type="text/javascript" charset="utf-8"> - hasFrames = window.top.frames.main ? true : false; + pathId = "R509::CertificateAuthority::Signer"; relpath = '../../'; - framesUrl = "../../frames.html#!" + escape(window.location.href); </script> <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script> <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script> </head> <body> - <div id="header"> - <div id="menu"> + <div class="nav_wrap"> + <iframe id="nav" src="../../class_list.html"></iframe> + <div id="resizer"></div> + </div> + + <div id="main" tabindex="-1"> + <div id="header"> + <div id="menu"> <a href="../../_index.html">Index (S)</a> &raquo; <span class='title'><span class='object_link'><a href="../../R509.html" title="R509 (module)">R509</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../CertificateAuthority.html" title="R509::CertificateAuthority (module)">CertificateAuthority</a></span></span> &raquo; <span class="title">Signer</span> - - <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> </div> - <div id="search"> + <div id="search"> <a class="full_list_link" id="class_list_link" href="../../class_list.html"> - Class List + + <svg width="24" height="24"> + <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect> + <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect> + </svg> </a> - <a class="full_list_link" id="method_list_link" - href="../../method_list.html"> - Method List - </a> - - <a class="full_list_link" id="file_list_link" - href="../../file_list.html"> - File List - </a> - </div> - <div class="clear"></div> - </div> + <div class="clear"></div> + </div> - <iframe id="search_frame"></iframe> + <iframe id="search_frame" src="../../class_list.html"></iframe> - <div id="content"><h1>Class: R509::CertificateAuthority::Signer + <div id="content"><h1>Class: R509::CertificateAuthority::Signer </h1> - -<dl class="box"> +<div class="box_info"> - <dt class="r1">Inherits:</dt> - <dd class="r1"> + <dl> + <dt>Inherits:</dt> + <dd> <span class="inheritName">Object</span> <ul class="fullTree"> <li>Object</li> <li class="next">R509::CertificateAuthority::Signer</li> </ul> <a href="#" class="inheritanceTree">show all</a> - </dd> - + </dd> + </dl> + - - - <dt class="r2 last">Defined in:</dt> - <dd class="r2 last">lib/r509/certificate_authority/signer.rb</dd> + -</dl> -<div class="clear"></div> + + <dl> + <dt>Defined in:</dt> + <dd>lib/r509/certificate_authority/signer.rb</dd> + </dl> + +</div> + <h2>Overview</h2><div class="docstring"> <div class="discussion"> <p>Contains the certification authority signing operation methods</p> @@ -118,19 +120,19 @@ <h2> Class Method Summary - <small>(<a href="#" class="summary_toggle">collapse</a>)</small> + <small><a href="#" class="summary_toggle">collapse</a></small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#selfsign-class_method" title="selfsign (class method)">+ (R509::Cert) <strong>selfsign</strong>(options) </a> + <a href="#build_cert-class_method" title="build_cert (class method)">.<strong>build_cert</strong>(options) &#x21d2; Object </a> </span> @@ -140,10 +142,76 @@ + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#check_options-class_method" title="check_options (class method)">.<strong>check_options</strong>(options) &#x21d2; Object </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#extract_public_key_subject-class_method" title="extract_public_key_subject (class method)">.<strong>extract_public_key_subject</strong>(options) &#x21d2; Object </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#selfsign-class_method" title="selfsign (class method)">.<strong>selfsign</strong>(options) &#x21d2; R509::Cert </a> + + + + </span> + + + + + + + + + <span class="summary_desc"><div class='inline'> <p>Self-signs a CSR.</p> </div></span> </li> @@ -151,19 +219,19 @@ </ul> <h2> Instance Method Summary - <small>(<a href="#" class="summary_toggle">collapse</a>)</small> + <small><a href="#" class="summary_toggle">collapse</a></small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#initialize-instance_method" title="#initialize (instance method)">- (Signer) <strong>initialize</strong>(config) </a> + <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(config) &#x21d2; Signer </a> </span> @@ -185,11 +253,11 @@ <li class="public "> <span class="summary_signature"> - <a href="#sign-instance_method" title="#sign (instance method)">- (R509::Cert) <strong>sign</strong>(options) </a> + <a href="#sign-instance_method" title="#sign (instance method)">#<strong>sign</strong>(options) &#x21d2; R509::Cert </a> </span> @@ -215,20 +283,20 @@ <h2>Constructor Details</h2> <div class="method_details first"> <h3 class="signature first" id="initialize-instance_method"> - - (<tt><span class='object_link'><a href="" title="R509::CertificateAuthority::Signer (class)">Signer</a></span></tt>) <strong>initialize</strong>(config) + #<strong>initialize</strong>(config) &#x21d2; <tt><span class='object_link'><a href="" title="R509::CertificateAuthority::Signer (class)">Signer</a></span></tt> </h3><div class="docstring"> <div class="discussion"> -<p>A new instance of Signer</p> +<p>Returns a new instance of Signer</p> </div> </div> <div class="tags"> @@ -270,14 +338,14 @@ <pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 12</span> <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> <span class='ivar'>@config</span> <span class='op'>=</span> <span class='id identifier rubyid_config'>config</span> - <span class='kw'>if</span> <span class='kw'>not</span> <span class='ivar'>@config</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'>@config</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</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> + <span class='kw'>if</span> <span class='ivar'>@config</span> <span class='op'>&amp;&amp;</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> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>config must be a kind of R509::Config::CAConfig</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span> - <span class='kw'>if</span> <span class='kw'>not</span> <span class='ivar'>@config</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'>@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> + <span class='kw'>if</span> <span class='ivar'>@config</span> <span class='op'>&amp;&amp;</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> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You must have a private key associated with your CA certificate to issue</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> @@ -290,18 +358,166 @@ <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> - <h3 class="signature first" id="selfsign-class_method"> + <h3 class="signature first" id="build_cert-class_method"> - + (<tt><span class='object_link'><a href="../Cert.html" title="R509::Cert (class)">R509::Cert</a></span></tt>) <strong>selfsign</strong>(options) + .<strong>build_cert</strong>(options) &#x21d2; <tt>Object</tt> +</h3><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 119</span> + +<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> + <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> + + <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> + <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> + <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> + <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> + <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> + <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> + <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 +</span> <span class='id identifier rubyid_cert'>cert</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="check_options-class_method"> + + .<strong>check_options</strong>(options) &#x21d2; <tt>Object</tt> + + + + + +</h3><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 107</span> + +<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> + <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'>&amp;&amp;</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='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You can&#39;t pass both :csr and :spki</span><span class='tstring_end'>&quot;</span></span> + <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'>&amp;&amp;</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> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You must supply either :csr or :spki</span><span class='tstring_end'>&quot;</span></span> + <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'>&amp;&amp;</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> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You must pass an R509::CSR object for :csr</span><span class='tstring_end'>&quot;</span></span> + <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'>&amp;&amp;</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> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You must pass an R509::SPKI object for :spki</span><span class='tstring_end'>&quot;</span></span> + <span class='kw'>end</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="extract_public_key_subject-class_method"> + + .<strong>extract_public_key_subject</strong>(options) &#x21d2; <tt>Object</tt> + + + + + +</h3><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 172</span> + +<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> + <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='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> + <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> + <span class='kw'>else</span> + <span class='comment'># spki +</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> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You must supply :subject when passing :spki</span><span class='tstring_end'>&quot;</span></span> + <span class='kw'>end</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'>:spki</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_public_key'>public_key</span> + <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> + <span class='kw'>end</span> + + <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> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="selfsign-class_method"> + + .<strong>selfsign</strong>(options) &#x21d2; <tt><span class='object_link'><a href="../Cert.html" title="R509::Cert (class)">R509::Cert</a></span></tt> + + + + + </h3><div class="docstring"> <div class="discussion"> <p>Self-signs a CSR</p> @@ -488,11 +704,11 @@ </td> <td> <pre class="code"><span class="info file"># File 'lib/r509/certificate_authority/signer.rb', line 70</span> <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> - <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_options'>options</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> + <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> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>You must pass a hash of options consisting of at minimum :csr</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span> <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> <span class='kw'>if</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_nil?'>nil?</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>CSR must also have a private key to self sign</span><span class='tstring_end'>&#39;</span></span> @@ -513,17 +729,17 @@ <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'>BasicConstraints</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='symbol'>:ca</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='comma'>,</span> <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'>SubjectKeyIdentifier</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'>=&gt;</span> <span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span><span class='comma'>,</span> <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'>=&gt;</span> <span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span> <span class='rbracket'>]</span> - <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</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> + <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> <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> <span class='kw'>else</span> <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> <span class='kw'>end</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='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> + <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> <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'>=&gt;</span> <span class='id identifier rubyid_cert'>cert</span><span class='comma'>,</span> <span class='symbol'>:key</span> <span class='op'>=&gt;</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> <span class='kw'>end</span></pre> </td> </tr> @@ -537,11 +753,11 @@ <div class="method_details first"> <h3 class="signature first" id="sign-instance_method"> - - (<tt><span class='object_link'><a href="../Cert.html" title="R509::Cert (class)">R509::Cert</a></span></tt>) <strong>sign</strong>(options) + #<strong>sign</strong>(options) &#x21d2; <tt><span class='object_link'><a href="../Cert.html" title="R509::Cert (class)">R509::Cert</a></span></tt> @@ -767,15 +983,15 @@ <span class='id identifier rubyid_cert'>cert</span><span class='period'>.</span><span class='id identifier rubyid_extensions'>extensions</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:extensions</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span> <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'>SubjectKeyIdentifier</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'>=&gt;</span> <span class='id identifier rubyid_public_key'>public_key</span><span class='rparen'>)</span><span class='comma'>,</span> <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'>=&gt;</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> <span class='rbracket'>]</span> - <span class='comment'>#@config.ca_cert.key.key ... ugly. ca_cert returns R509::Cert + <span class='comment'># @config.ca_cert.key.key ... ugly. ca_cert returns R509::Cert </span> <span class='comment'># #key returns R509::PrivateKey and #key on that returns OpenSSL object we need -</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> +</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> <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'>=&gt;</span> <span class='id identifier rubyid_cert'>cert</span> <span class='rbrace'>}</span> - <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='kw'>not</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_nil?'>nil?</span> <span class='kw'>and</span> <span class='kw'>not</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='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> + <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'>&amp;&amp;</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='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> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -783,13 +999,14 @@ </div> </div> - <div id="footer"> - Generated on Sun Jan 26 13:37:28 2014 by + <div id="footer"> + Generated on Tue Dec 6 17:27:41 2016 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.8.6.1 (ruby-2.0.0). + 0.9.5 (ruby-2.4.0). </div> + </div> </body> </html> \ No newline at end of file