doc/R509/Cert/Extensions/PolicyConstraints.html in r509-0.9.2 vs doc/R509/Cert/Extensions/PolicyConstraints.html in r509-0.10.0

- old
+ new

@@ -4,17 +4,17 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Class: R509::Cert::Extensions::PolicyConstraints - &mdash; Documentation by YARD 0.8.5 + &mdash; Documentation by YARD 0.8.6.1 </title> - <link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" /> + <link rel="stylesheet" href="../../../css/style.css" type="text/css" charset="utf-8" /> - <link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" 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; relpath = '../../../'; framesUrl = "../../../frames.html#!" + escape(window.location.href); @@ -90,26 +90,54 @@ + <dt class="r2">Includes:</dt> + <dd class="r2"><span class='object_link'><a href="ValidationMixin.html" title="R509::Cert::Extensions::ValidationMixin (module)">ValidationMixin</a></span></dd> + + - <dt class="r2 last">Defined in:</dt> - <dd class="r2 last">lib/r509/cert/extensions.rb</dd> + <dt class="r1 last">Defined in:</dt> + <dd class="r1 last">lib/r509/cert/extensions/policy_constraints.rb</dd> </dl> <div class="clear"></div> <h2>Overview</h2><div class="docstring"> <div class="discussion"> -<p>Implements the PolicyConstraints certificate extension, with methods to -provide access to the components and meaning of the extension's contents.</p> +<p>RFC 5280 Description (see: <a +href="http://www.ietf.org/rfc/rfc5280.txt">www.ietf.org/rfc/rfc5280.txt</a>)</p> +<p>The policy constraints extension can be used in certificates issued to CAs. +The policy constraints extension constrains path validation in two ways. +It can be used to prohibit policy mapping or require that each certificate +in a path contain an acceptable policy identifier.</p> +<p>If the inhibitPolicyMapping field is present, the value indicates the +number of additional certificates that may appear in the path before policy +mapping is no longer permitted. For example, a value of one indicates that +policy mapping may be processed in certificates issued by the subject of +this certificate, but not in additional certificates in the path.</p> + +<p>If the requireExplicitPolicy field is present, the value of +requireExplicitPolicy indicates the number of additional certificates that +may appear in the path before an explicit policy is required for the entire +path. When an explicit policy is required, it is necessary for all +certificates in the path to contain an acceptable policy identifier in the +certificate policies extension. An acceptable policy identifier is the +identifier of a policy required by the user of the certification path or +the identifier of a policy that has been declared equivalent through policy +mapping.</p> + +<p>You can use this extension to parse an existing extension for easy access +to the contents or create a new one.</p> + + </div> </div> <div class="tags"> @@ -144,11 +172,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#inhibit_policy_mapping-instance_method" title="#inhibit_policy_mapping (instance method)">- (Object) <strong>inhibit_policy_mapping</strong> </a> + <a href="#inhibit_policy_mapping-instance_method" title="#inhibit_policy_mapping (instance method)">- (Integer<sup>?</sup>) <strong>inhibit_policy_mapping</strong> </a> </span> @@ -163,21 +191,19 @@ - <span class="summary_desc"><div class='inline'> -<p>Returns the value of attribute inhibit_policy_mapping.</p> -</div></span> + <span class="summary_desc"><div class='inline'></div></span> </li> <li class="public "> <span class="summary_signature"> - <a href="#require_explicit_policy-instance_method" title="#require_explicit_policy (instance method)">- (Object) <strong>require_explicit_policy</strong> </a> + <a href="#require_explicit_policy-instance_method" title="#require_explicit_policy (instance method)">- (Integer<sup>?</sup>) <strong>require_explicit_policy</strong> </a> </span> @@ -192,13 +218,11 @@ - <span class="summary_desc"><div class='inline'> -<p>Returns the value of attribute require_explicit_policy.</p> -</div></span> + <span class="summary_desc"><div class='inline'></div></span> </li> </ul> @@ -215,11 +239,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#initialize-instance_method" title="#initialize (instance method)">- (PolicyConstraints) <strong>initialize</strong>(*args) </a> + <a href="#initialize-instance_method" title="#initialize (instance method)">- (PolicyConstraints) <strong>initialize</strong>(arg) </a> </span> @@ -232,88 +256,173 @@ <span class="summary_desc"><div class='inline'> -<p>A new instance of PolicyConstraints.</p> +<p>This method takes a hash or an existing Extension object to parse.</p> </div></span> </li> + <li class="public "> + <span class="summary_signature"> + + <a href="#to_h-instance_method" title="#to_h (instance method)">- (Hash) <strong>to_h</strong> </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + + <li class="public "> + <span class="summary_signature"> + + <a href="#to_yaml-instance_method" title="#to_yaml (instance method)">- (YAML) <strong>to_yaml</strong> </a> + + + + </span> + + + + + + + + + + <span class="summary_desc"><div class='inline'></div></span> + +</li> + + </ul> + + <div id="constructor_details" class="method_details_list"> <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::Cert::Extensions::PolicyConstraints (class)">PolicyConstraints</a></span></tt>) <strong>initialize</strong>(*args) + - (<tt><span class='object_link'><a href="" title="R509::Cert::Extensions::PolicyConstraints (class)">PolicyConstraints</a></span></tt>) <strong>initialize</strong>(arg) </h3><div class="docstring"> <div class="discussion"> -<p>A new instance of PolicyConstraints</p> +<p>This method takes a hash or an existing Extension object to parse</p> </div> </div> <div class="tags"> + <p class="tag_title">Parameters:</p> +<ul class="param"> + <li> + + <span class='name'>arg</span> + + + <span class='type'>(<tt>Hash</tt>)</span> + + + + &mdash; + <div class='inline'> +<p>a customizable set of options</p> +</div> + + </li> + +</ul> + + + + <p class="tag_title">Options Hash (<tt>arg</tt>):</p> + <ul class="option"> + + <li> + <span class="name">:require_explicit_policy</span> + <span class="type">(<tt>Integer</tt>)</span> + <span class="default"> + + </span> + + </li> + + <li> + <span class="name">:inhibit_policy_mapping</span> + <span class="type">(<tt>Integer</tt>)</span> + <span class="default"> + + </span> + + </li> + + <li> + <span class="name">:critical</span> + <span class="type">(<tt>Boolean</tt>)</span> + <span class="default"> + + &mdash; default: + <tt>true</tt> + + </span> + + </li> + + </ul> + + + </div><table class="source_code"> <tr> <td> <pre class="lines"> -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576</pre> +51 +52 +53 +54 +55 +56 +57 +58</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 559</span> + <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/policy_constraints.rb', line 51</span> -<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> - <span class='kw'>super</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span> - - <span class='comment'># id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 } -</span> <span class='comment'># PolicyConstraints ::= SEQUENCE { -</span> <span class='comment'># requireExplicitPolicy [0] SkipCerts OPTIONAL, -</span> <span class='comment'># inhibitPolicyMapping [1] SkipCerts OPTIONAL } -</span> <span class='comment'># -</span> <span class='comment'># SkipCerts ::= INTEGER (0..MAX) -</span> <span class='id identifier rubyid_data'>data</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_get_extension_payload'>get_extension_payload</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span> - <span class='id identifier rubyid_data'>data</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_pc'>pc</span><span class='op'>|</span> - <span class='kw'>if</span> <span class='id identifier rubyid_pc'>pc</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span> <span class='op'>==</span> <span class='int'>0</span> - <span class='ivar'>@require_explicit_policy</span> <span class='op'>=</span> <span class='id identifier rubyid_pc'>pc</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> - <span class='kw'>elsif</span> <span class='id identifier rubyid_pc'>pc</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span> <span class='op'>==</span> <span class='int'>1</span> - <span class='ivar'>@inhibit_policy_mapping</span> <span class='op'>=</span> <span class='id identifier rubyid_pc'>pc</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_bytes'>bytes</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> - <span class='kw'>end</span> +<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> + <span class='kw'>if</span> <span class='kw'>not</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='period'>.</span><span class='id identifier rubyid_is_extension?'>is_extension?</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> + <span class='id identifier rubyid_arg'>arg</span> <span class='op'>=</span> <span class='id identifier rubyid_build_extension'>build_extension</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> <span class='kw'>end</span> + + <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_arg'>arg</span><span class='rparen'>)</span> + <span class='id identifier rubyid_parse_extension'>parse_extension</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -326,39 +435,50 @@ <span id=""></span> <div class="method_details first"> <h3 class="signature first" id="inhibit_policy_mapping-instance_method"> - - (<tt>Object</tt>) <strong>inhibit_policy_mapping</strong> <span class="extras">(readonly)</span> + - (<tt>Integer</tt><sup>?</sup>) <strong>inhibit_policy_mapping</strong> <span class="extras">(readonly)</span> </h3><div class="docstring"> <div class="discussion"> -<p>Returns the value of attribute inhibit_policy_mapping</p> - </div> </div> <div class="tags"> +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Integer</tt>, <tt>nil</tt>)</span> + + + + </li> + +</ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> -557 -558 -559</pre> +44 +45 +46</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 557</span> + <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/policy_constraints.rb', line 44</span> <span class='kw'>def</span> <span class='id identifier rubyid_inhibit_policy_mapping'>inhibit_policy_mapping</span> <span class='ivar'>@inhibit_policy_mapping</span> <span class='kw'>end</span></pre> </td> @@ -369,39 +489,50 @@ <span id=""></span> <div class="method_details "> <h3 class="signature " id="require_explicit_policy-instance_method"> - - (<tt>Object</tt>) <strong>require_explicit_policy</strong> <span class="extras">(readonly)</span> + - (<tt>Integer</tt><sup>?</sup>) <strong>require_explicit_policy</strong> <span class="extras">(readonly)</span> </h3><div class="docstring"> <div class="discussion"> -<p>Returns the value of attribute require_explicit_policy</p> - </div> </div> <div class="tags"> +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Integer</tt>, <tt>nil</tt>)</span> + + + + </li> + +</ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> -556 -557 -558</pre> +42 +43 +44</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions.rb', line 556</span> + <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/policy_constraints.rb', line 42</span> <span class='kw'>def</span> <span class='id identifier rubyid_require_explicit_policy'>require_explicit_policy</span> <span class='ivar'>@require_explicit_policy</span> <span class='kw'>end</span></pre> </td> @@ -410,15 +541,135 @@ </div> </div> + <div id="instance_method_details" class="method_details_list"> + <h2>Instance Method Details</h2> + + + <div class="method_details first"> + <h3 class="signature first" id="to_h-instance_method"> + + - (<tt>Hash</tt>) <strong>to_h</strong> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> </div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>Hash</tt>)</span> + + + + </li> + +</ul> +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +61 +62 +63 +64 +65 +66 +67 +68</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/policy_constraints.rb', line 61</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span> + <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='lbrace'>{</span> + <span class='symbol'>:critical</span> <span class='op'>=&gt;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_critical?'>critical?</span> + <span class='rbrace'>}</span> + <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:require_explicit_policy</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@require_explicit_policy</span> <span class='kw'>unless</span> <span class='ivar'>@require_explicit_policy</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> + <span class='id identifier rubyid_hash'>hash</span><span class='lbracket'>[</span><span class='symbol'>:inhibit_policy_mapping</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='ivar'>@inhibit_policy_mapping</span> <span class='kw'>unless</span> <span class='ivar'>@inhibit_policy_mapping</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> + <span class='id identifier rubyid_hash'>hash</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + <div class="method_details "> + <h3 class="signature " id="to_yaml-instance_method"> + + - (<tt>YAML</tt>) <strong>to_yaml</strong> + + + + + +</h3><div class="docstring"> + <div class="discussion"> + + + </div> +</div> +<div class="tags"> + +<p class="tag_title">Returns:</p> +<ul class="return"> + + <li> + + + <span class='type'>(<tt>YAML</tt>)</span> + + + + </li> + +</ul> + +</div><table class="source_code"> + <tr> + <td> + <pre class="lines"> + + +71 +72 +73</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/r509/cert/extensions/policy_constraints.rb', line 71</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_to_yaml'>to_yaml</span> + <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='period'>.</span><span class='id identifier rubyid_to_yaml'>to_yaml</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> +</div> + + </div> + +</div> + <div id="footer"> - Generated on Tue Apr 23 10:46:07 2013 by + Generated on Sun Jan 26 13:37:28 2014 by <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> - 0.8.5 (ruby-1.9.3). + 0.8.6.1 (ruby-2.0.0). </div> </body> </html> \ No newline at end of file