るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
16件ヒット [1-16件を表示] (0.144秒)

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

検索結果

OpenSSL::BN#clear_bit!(n) -> self (18382.0)

自身の n ビット目を0にします。

...自身の n ビット目を0にします。

//emlist[][ruby]{
require 'openssl'

a = OpenSSL::BN.new("129")
a.clear_bit!(0)
a # => 128
//}

@param n 0にするビットの位置
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::set_bit!...

OpenSSL::X509::Name#to_a -> [[String, String, Integer]] (18349.0)

内容を配列にして返します。

...、[属性型文字列、属性値文字列、属性値の型を表す整数(OpenSSL::ASN1以下の各定数で定義されているASN1の型)] という3要素の配列です。

例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN=foo...

OpenSSL::ASN1::ObjectId#long_name -> String | nil (18328.0)

オブジェクト識別子に対応する long name を返します。

...オブジェクト識別子に対応する long name を返します。

例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.ln #=> "X509v3 Subject Alternative Name"

@see OpenSSL::ASN1::ObjectId#sn...

OpenSSL::ASN1::ObjectId#short_name -> String | nil (18328.0)

オブジェクト識別子に対応する short name を返します。

...オブジェクト識別子に対応する short name を返します。

例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.sn #=> "subjectAltName"

@see OpenSSL::ASN1::ObjectId#ln...

OpenSSL::BN#mask_bits!(n) -> self (18328.0)

自身を下位 n ビットでマスクし、破壊的に変更します。

...きい場合は例外 OpenSSL::BNError
が発生します。

//emlist[][ruby]{
require 'openssl'

bn = 0b1111_1111.to_bn

bn.mask_bits!(8)
p "%b" % bn # => "11111111"

bn.mask_bits!(3)
p "%b" % bn # => "111"
//}

@param n マスクするビット数
@raise OpenSSL::BNError 計算時...

絞り込み条件を変える

OpenSSL::BN#mod_add(other, m) -> OpenSSL::BN (18328.0)

(self + other) % m を返します。

...(self + other) % m を返します。

//emlist[][ruby]{
require 'openssl'

OpenSSL
::BN.new("7").mod_add(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 4
//}

@param other 和を取る数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー...

OpenSSL::BN#prime_fasttest?(checks=nil, vtrivdiv=true) -> bool (18328.0)

自身が素数であるなら true を返します。

...繰り返します。
checksがnilである場合は OpenSSL が適切な
回数を判断します。

//emlist[][ruby]{
require 'openssl'

# 181 は 「小さな素数」である
OpenSSL
::BN.new("181").prime_fasttest?(nil, true) # => false
OpenSSL
::BN.new("181").prime_fasttest?(nil, false) # => tr...
...ue
//}

@param checks Miller-Robin法の繰り返しの回数
@param vtrivdiv 真なら小さな素数で割ることでの素数判定を試みます
@raise OpenSSL::BNError 判定時にエラーが発生
@see OpenSSL::BN#prime?...

OpenSSL::Config#each {|section, key, value| ... } -> self (18328.0)

オブジェクトに含まれる全ての設定情報を順にブロックに渡し 呼び出します。

...を表す文字列、キーを表す文字列、キーに
割り当てられた値の文字列、の3つです。

require 'openssl'
conf = OpenSSL::Config.load(OpenSSL::Config::DEFAULT_CONFIG_FILE)
conf.each{|section, key, value| p [section, key, value]}
# => ["req_distinguished_name", "cou...

OpenSSL::X509::Name#to_s(flags=nil) -> String (9328.0)

DNの文字列表現を返します。

...は通常は以下のいずれかを渡します。
* nil
* OpenSSL::X509::Name::COMPAT
* OpenSSL::X509::Name::RFC2253
* OpenSSL::X509::Name::ONELINE
* OpenSSL::X509::Name::MULTILINE

*
例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Compan...
...y/OU=Lab3/CN=foobar/emailAddress=foobar@lab3.example.co.jp"
n.to_s(OpenSSL::X509::Name::COMPAT)
# => "C=JP, ST=Kanagawa, L=Yokohama, O=Example Company, OU=Lab3, CN=foobar/emailAddress=foobar@lab3.example.co.jp"
n.to_s(OpenSSL::X509::Name::RFC2253)
# => "emailAddress=foobar@lab3.example.co.jp...
...Lab3,O=Example Company,L=Yokohama,ST=Kanagawa,C=JP"
n.to_s(OpenSSL::X509::Name::ONELINE)
# => "C = JP, ST = Kanagawa, L = Yokohama, O = Example Company, OU = Lab3, CN = foobar, emailAddress = foobar@lab3.example.co.jp"
n.to_s(OpenSSL::X509::Name::MULTILINE)
# => "countryName =...

OpenSSL::ASN1::ObjectId#ln -> String | nil (9028.0)

オブジェクト識別子に対応する long name を返します。

...オブジェクト識別子に対応する long name を返します。

例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.ln #=> "X509v3 Subject Alternative Name"

@see OpenSSL::ASN1::ObjectId#sn...

絞り込み条件を変える

OpenSSL::ASN1::ObjectId#oid -> String (9028.0)

オブジェクト識別子のドット区切り数値を文字列で返します。

...ブジェクト識別子のドット区切り数値を文字列で返します。

例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.oid #=> "2.5.29.17"

@raise OpenSSL::ASN1::ASN1Error オブジェクト識別子名が未知である場合に発生します...

OpenSSL::ASN1::ObjectId#sn -> String | nil (9028.0)

オブジェクト識別子に対応する short name を返します。

...オブジェクト識別子に対応する short name を返します。

例:
require "openssl"
oid = OpenSSL::ASN1::ObjectId.new("subjectAltName")
p oid.sn #=> "subjectAltName"

@see OpenSSL::ASN1::ObjectId#ln...

OpenSSL::X509::ExtensionFactory#config=(config) (9028.0)

自身にコンフィグファイルオブジェクトを設定します。

...自身にコンフィグファイルオブジェクトを設定します。


require 'openssl'
factory.config = OpenSSL::Config.load(OpenSSL::Config::DEFAULT_CONFIG_FILE)

@param config 設定ファイル(OpenSSL::Config オブジェクト)...

OpenSSL::BN#to_s(base=10) -> String (400.0)

自身を表す文字列を返します。

...
0 MPI形式の文字列(バイト列)

@param base 文字列への変換方法(基数)
@raise OpenSSL::BNError 変換に失敗した場合に発生します

//emlist[][ruby]{
require 'openssl'

p 10.to_bn.to_s # => "10"
p (-5).to_bn.to_s # => "-5"

p 0.to_bn.to_s(16) # => "0"
p 9.to_...
...o_s(2) # => "\a"

p 0.to_bn.to_s(0) # => "\x00\x00\x00\x00"
p 6.to_bn.to_s(0) # => "\x00\x00\x00\x01\x06"
p 7.to_bn.to_s(0) # => "\x00\x00\x00\x01\a"
//}

反対に、文字列から OpenSSL::BN クラスのインスタンスを作るには
OpenSSL
::BN.new を用います。

@see OpenSSL::BN.new...

OpenSSL::BN#coerce(other) -> Array (328.0)

自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。

...換後オブジェクト] にして返します。
それ以外の場合は例外 TypeError を発生させます。

//emlist[][ruby]{
require 'openssl'
p 1.to_bn.coerce(2) # => [2, 1]
//}

@param other 変換の基準となるオブジェクト
@raise TypeError 変換に失敗した場合に発...

絞り込み条件を変える

OpenSSL::BN#set_bit!(n) -> self (82.0)

自身の n ビット目を1にします。

...自身の n ビット目を1にします。

//emlist[][ruby]{
require 'openssl'

a = OpenSSL::BN.new("128")
a.set_bit!(0)
a # => 129
//}

@param n 1にするビットの位置
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::clear_bit!, OpenSSL::bit_set?...