doc/R509/ASN1/GeneralName.html in r509-0.9.2 vs doc/R509/ASN1/GeneralName.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::ASN1::GeneralName - &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); @@ -131,11 +131,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#serial_prefix-instance_method" title="#serial_prefix (instance method)">- (Object) <strong>serial_prefix</strong> </a> + <a href="#short_type-instance_method" title="#short_type (instance method)">- (Object) <strong>short_type</strong> </a> </span> @@ -261,11 +261,11 @@ <ul class="summary"> <li class="public "> <span class="summary_signature"> - <a href="#map_tag_to_serial_prefix-class_method" title="map_tag_to_serial_prefix (class method)">+ (String) <strong>map_tag_to_serial_prefix</strong>(tag) </a> + <a href="#map_tag_to_short_type-class_method" title="map_tag_to_short_type (class method)">+ (String) <strong>map_tag_to_short_type</strong>(tag) </a> </span> @@ -390,10 +390,32 @@ </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> + + </ul> <div id="constructor_details" class="method_details_list"> <h2>Constructor Details</h2> @@ -428,11 +450,11 @@ &mdash; <div class='inline'> -<p>ASN.1 input data. Can also pass a hash with :tag and :value keys</p> +<p>ASN.1 input data. Can also pass a hash with (:tag or :type) and :value keys</p> </div> </li> </ul> @@ -442,78 +464,28 @@ <tr> <td> <pre class="lines"> -74 -75 -76 -77 -78 79 80 81 82 83 84 85 -86 -87 -88 -89 -90 -91 -92 -93 -94 -95 -96 -97 -98 -99 -100 -101 -102 -103 -104 -105 -106</pre> +86</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 74</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 79</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_asn'>asn</span><span class='rparen'>)</span> - <span class='kw'>if</span> <span class='id identifier rubyid_asn'>asn</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'>and</span> <span class='id identifier rubyid_asn'>asn</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:tag</span><span class='rparen'>)</span> <span class='kw'>and</span> <span class='id identifier rubyid_asn'>asn</span><span class='period'>.</span><span class='id identifier rubyid_has_key?'>has_key?</span><span class='lparen'>(</span><span class='symbol'>:value</span><span class='rparen'>)</span> + <span class='kw'>if</span> <span class='id identifier rubyid_asn'>asn</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='comment'># this is added via create_item -</span> <span class='ivar'>@tag</span> <span class='op'>=</span> <span class='id identifier rubyid_asn'>asn</span><span class='lbracket'>[</span><span class='symbol'>:tag</span><span class='rbracket'>]</span> - <span class='ivar'>@type</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='op'>::</span><span class='const'>GeneralName</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_type'>map_tag_to_type</span><span class='lparen'>(</span><span class='ivar'>@tag</span><span class='rparen'>)</span> - <span class='ivar'>@serial_prefix</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='op'>::</span><span class='const'>GeneralName</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_serial_prefix'>map_tag_to_serial_prefix</span><span class='lparen'>(</span><span class='ivar'>@tag</span><span class='rparen'>)</span> - <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_asn'>asn</span><span class='lbracket'>[</span><span class='symbol'>:value</span><span class='rbracket'>]</span> +</span> <span class='id identifier rubyid_parse_hash'>parse_hash</span><span class='lparen'>(</span><span class='id identifier rubyid_asn'>asn</span><span class='rparen'>)</span> <span class='kw'>else</span> - <span class='ivar'>@tag</span> <span class='op'>=</span> <span class='id identifier rubyid_asn'>asn</span><span class='period'>.</span><span class='id identifier rubyid_tag'>tag</span> - <span class='ivar'>@type</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='op'>::</span><span class='const'>GeneralName</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_type'>map_tag_to_type</span><span class='lparen'>(</span><span class='ivar'>@tag</span><span class='rparen'>)</span> - <span class='ivar'>@serial_prefix</span> <span class='op'>=</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>ASN1</span><span class='op'>::</span><span class='const'>GeneralName</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_serial_prefix'>map_tag_to_serial_prefix</span><span class='lparen'>(</span><span class='ivar'>@tag</span><span class='rparen'>)</span> - <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_asn'>asn</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span> - <span class='kw'>case</span> <span class='ivar'>@tag</span> - <span class='kw'>when</span> <span class='int'>1</span> <span class='kw'>then</span> <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span> - <span class='kw'>when</span> <span class='int'>2</span> <span class='kw'>then</span> <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span> - <span class='kw'>when</span> <span class='int'>4</span> <span class='kw'>then</span> <span class='ivar'>@value</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_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span><span class='period'>.</span><span class='id identifier rubyid_to_der'>to_der</span><span class='rparen'>)</span> - <span class='kw'>when</span> <span class='int'>6</span> <span class='kw'>then</span> <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span> - <span class='kw'>when</span> <span class='int'>7</span> - <span class='kw'>if</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>4</span> <span class='kw'>or</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>16</span> - <span class='id identifier rubyid_ip'>ip</span> <span class='op'>=</span> <span class='const'>IPAddr</span><span class='period'>.</span><span class='id identifier rubyid_new_ntoh'>new_ntoh</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> - <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> - <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>8</span> <span class='comment'>#IPv4 with netmask -</span> <span class='id identifier rubyid_ip'>ip</span> <span class='op'>=</span> <span class='const'>IPAddr</span><span class='period'>.</span><span class='id identifier rubyid_new_ntoh'>new_ntoh</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>4</span><span class='rbracket'>]</span><span class='rparen'>)</span> - <span class='id identifier rubyid_netmask'>netmask</span> <span class='op'>=</span> <span class='const'>IPAddr</span><span class='period'>.</span><span class='id identifier rubyid_new_ntoh'>new_ntoh</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>4</span><span class='rbracket'>]</span><span class='rparen'>)</span> - <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_netmask'>netmask</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> - <span class='kw'>elsif</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>==</span> <span class='int'>32</span> <span class='comment'>#IPv6 with netmask -</span> <span class='id identifier rubyid_ip'>ip</span> <span class='op'>=</span> <span class='const'>IPAddr</span><span class='period'>.</span><span class='id identifier rubyid_new_ntoh'>new_ntoh</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='int'>16</span><span class='rbracket'>]</span><span class='rparen'>)</span> - <span class='id identifier rubyid_netmask'>netmask</span> <span class='op'>=</span> <span class='const'>IPAddr</span><span class='period'>.</span><span class='id identifier rubyid_new_ntoh'>new_ntoh</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='lbracket'>[</span><span class='int'>16</span><span class='comma'>,</span><span class='int'>16</span><span class='rbracket'>]</span><span class='rparen'>)</span> - <span class='ivar'>@value</span> <span class='op'>=</span> <span class='id identifier rubyid_ip'>ip</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_netmask'>netmask</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> - <span class='kw'>end</span> - <span class='kw'>end</span> + <span class='id identifier rubyid_parse_asn'>parse_asn</span><span class='lparen'>(</span><span class='id identifier rubyid_asn'>asn</span><span class='rparen'>)</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -525,22 +497,23 @@ <h2>Instance Attribute Details</h2> <span id=""></span> <div class="method_details first"> - <h3 class="signature first" id="serial_prefix-instance_method"> + <h3 class="signature first" id="short_type-instance_method"> - - (<tt>Object</tt>) <strong>serial_prefix</strong> <span class="extras">(readonly)</span> + - (<tt>Object</tt>) <strong>short_type</strong> <span class="extras">(readonly)</span> </h3><div class="docstring"> <div class="discussion"> -<p>The prefix OpenSSL needs for this type when encoding it into an extension.</p> +<p>The prefix OpenSSL needs for this type when encoding it into an extension. +Also used by the YAML serialization in the extensions</p> </div> </div> <div class="tags"> @@ -550,19 +523,19 @@ <tr> <td> <pre class="lines"> -67 -68 -69</pre> +72 +73 +74</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 67</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 72</span> -<span class='kw'>def</span> <span class='id identifier rubyid_serial_prefix'>serial_prefix</span> - <span class='ivar'>@serial_prefix</span> +<span class='kw'>def</span> <span class='id identifier rubyid_short_type'>short_type</span> + <span class='ivar'>@short_type</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> @@ -593,16 +566,16 @@ <tr> <td> <pre class="lines"> -71 -72 -73</pre> +76 +77 +78</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 71</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 76</span> <span class='kw'>def</span> <span class='id identifier rubyid_tag'>tag</span> <span class='ivar'>@tag</span> <span class='kw'>end</span></pre> </td> @@ -637,16 +610,16 @@ <tr> <td> <pre class="lines"> -65 -66 -67</pre> +69 +70 +71</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 65</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 69</span> <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span> <span class='ivar'>@type</span> <span class='kw'>end</span></pre> </td> @@ -680,16 +653,16 @@ <tr> <td> <pre class="lines"> -69 -70 -71</pre> +74 +75 +76</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 69</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 74</span> <span class='kw'>def</span> <span class='id identifier rubyid_value'>value</span> <span class='ivar'>@value</span> <span class='kw'>end</span></pre> </td> @@ -703,13 +676,13 @@ <div id="class_method_details" class="method_details_list"> <h2>Class Method Details</h2> <div class="method_details first"> - <h3 class="signature first" id="map_tag_to_serial_prefix-class_method"> + <h3 class="signature first" id="map_tag_to_short_type-class_method"> - + (<tt>String</tt>) <strong>map_tag_to_serial_prefix</strong>(tag) + + (<tt>String</tt>) <strong>map_tag_to_short_type</strong>(tag) @@ -761,34 +734,34 @@ <tr> <td> <pre class="lines"> -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146</pre> +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 136</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 116</span> -<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_serial_prefix'>map_tag_to_serial_prefix</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='rparen'>)</span> +<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_short_type'>map_tag_to_short_type</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_tag'>tag</span> <span class='kw'>when</span> <span class='int'>1</span> <span class='kw'>then</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>email</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>when</span> <span class='int'>2</span> <span class='kw'>then</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>DNS</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>when</span> <span class='int'>4</span> <span class='kw'>then</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>dirName</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>when</span> <span class='int'>6</span> <span class='kw'>then</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>URI</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>when</span> <span class='int'>7</span> <span class='kw'>then</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>IP</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>else</span> - <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unimplemented GeneralName tag: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tag'>tag</span><span class='rbrace'>}</span><span class='tstring_content'>. At this time R509 does not support GeneralName types other than rfc822Name, dNSName, uniformResourceIdentifier, iPAddress, and directoryName</span><span class='tstring_end'>&quot;</span></span> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Unimplemented GeneralName tag: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tag'>tag</span><span class='embexpr_end'>}</span><span class='tstring_content'>. At this time R509 does not support GeneralName types other than rfc822Name, dNSName, uniformResourceIdentifier, iPAddress, and directoryName</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -851,28 +824,28 @@ <tr> <td> <pre class="lines"> -150 -151 -152 -153 -154 -155 -156 -157 -158 -159 -160 -161 -162 -163 -164</pre> +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 150</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 130</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map_tag_to_type'>map_tag_to_type</span><span class='lparen'>(</span><span class='id identifier rubyid_tag'>tag</span><span class='rparen'>)</span> <span class='kw'>case</span> <span class='id identifier rubyid_tag'>tag</span> <span class='kw'>when</span> <span class='int'>0</span> <span class='kw'>then</span> <span class='symbol'>:otherName</span> <span class='kw'>when</span> <span class='int'>1</span> <span class='kw'>then</span> <span class='symbol'>:rfc822Name</span> @@ -882,11 +855,11 @@ <span class='kw'>when</span> <span class='int'>5</span> <span class='kw'>then</span> <span class='symbol'>:ediPartyName</span> <span class='kw'>when</span> <span class='int'>6</span> <span class='kw'>then</span> <span class='symbol'>:uniformResourceIdentifier</span> <span class='kw'>when</span> <span class='int'>7</span> <span class='kw'>then</span> <span class='symbol'>:iPAddress</span> <span class='kw'>when</span> <span class='int'>8</span> <span class='kw'>then</span> <span class='symbol'>:registeredID</span> <span class='kw'>else</span> - <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid tag </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tag'>tag</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> + <span class='id identifier rubyid_raise'>raise</span> <span class='const'>R509Error</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>Invalid tag </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tag'>tag</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> @@ -954,35 +927,35 @@ <tr> <td> <pre class="lines"> +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 111 -112 -113 -114 -115 -116 -117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132</pre> +112</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 111</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 91</span> <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_map_type_to_tag'>map_type_to_tag</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='rparen'>)</span> <span class='comment'># otherName [0] OtherName, </span> <span class='comment'># rfc822Name [1] IA5String, </span> <span class='comment'># dNSName [2] IA5String, @@ -1058,64 +1031,98 @@ <tr> <td> <pre class="lines"> -182 -183 -184 -185 -186 -187 -188 -189 -190 -191 -192 -193 -194 -195 -196 -197 -198 -199 -200</pre> +169 +170 +171 +172 +173 +174 +175 +176</pre> </td> <td> - <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 182</span> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 169</span> <span class='kw'>def</span> <span class='id identifier rubyid_serialize_name'>serialize_name</span> <span class='kw'>if</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span> <span class='op'>==</span> <span class='symbol'>:directoryName</span> - <span class='id identifier rubyid_conf_name'>conf_name</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>Random</span><span class='period'>.</span><span class='id identifier rubyid_random_bytes'>random_bytes</span><span class='lparen'>(</span><span class='int'>16</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_unpack'>unpack</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>H*</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> - <span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> - <span class='id identifier rubyid_conf'>conf</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>[</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_conf_name'>conf_name</span><span class='rbrace'>}</span><span class='tstring_content'>]</span><span class='tstring_end'>&quot;</span></span> - <span class='ivar'>@value</span><span class='period'>.</span><span class='id identifier rubyid_to_a'>to_a</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_el'>el</span><span class='op'>|</span> - <span class='id identifier rubyid_conf'>conf</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_el'>el</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_el'>el</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span> - <span class='kw'>end</span> - <span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='id identifier rubyid_conf'>conf</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>\n</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> - <span class='id identifier rubyid_extension_string'>extension_string</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_serial_prefix'>serial_prefix</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid_conf_name'>conf_name</span> + <span class='kw'>return</span> <span class='id identifier rubyid_serialize_directory_name'>serialize_directory_name</span> <span class='kw'>else</span> - <span class='id identifier rubyid_conf'>conf</span> <span class='op'>=</span> <span class='kw'>nil</span> - <span class='id identifier rubyid_extension_string'>extension_string</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_serial_prefix'>serial_prefix</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span> + <span class='id identifier rubyid_extension_string'>extension_string</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_short_type'>short_type</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>:</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span> + <span class='kw'>return</span> <span class='lbrace'>{</span> <span class='symbol'>:conf</span> <span class='op'>=&gt;</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='symbol'>:extension_string</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_extension_string'>extension_string</span> <span class='rbrace'>}</span> <span class='kw'>end</span> - <span class='lbrace'>{</span> - <span class='symbol'>:conf</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_conf'>conf</span><span class='comma'>,</span> - <span class='symbol'>:extension_string</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_extension_string'>extension_string</span> - <span class='rbrace'>}</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> + <div class="method_details "> + <h3 class="signature " 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"> + + +147 +148 +149 +150 +151</pre> + </td> + <td> + <pre class="code"><span class="info file"># File 'lib/r509/asn1.rb', line 147</span> + +<span class='kw'>def</span> <span class='id identifier rubyid_to_h'>to_h</span> + <span class='id identifier rubyid_val'>val</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@value</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'>Subject</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='op'>?</span> <span class='ivar'>@value</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span> <span class='op'>:</span> <span class='ivar'>@value</span> + + <span class='lbrace'>{</span> <span class='symbol'>:type</span> <span class='op'>=&gt;</span> <span class='ivar'>@short_type</span><span class='comma'>,</span> <span class='symbol'>:value</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_val'>val</span> <span class='rbrace'>}</span> +<span class='kw'>end</span></pre> + </td> + </tr> +</table> </div> + + </div> +</div> + <div id="footer"> - Generated on Tue Apr 23 10:46:05 2013 by + Generated on Sun Jan 26 13:37:26 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