別のキーワード
種類
- 特異メソッド (5)
- インスタンスメソッド (4)
- モジュール関数 (3)
- モジュール (1)
クラス
- Integer (1)
-
OpenSSL
:: ASN1 :: Integer (2) -
OpenSSL
:: BN (6)
モジュール
-
OpenSSL
:: ASN1 (3)
検索結果
先頭5件
- OpenSSL
:: ASN1 . # Integer(value) -> OpenSSL :: ASN1 :: Integer - OpenSSL
:: ASN1 . # Integer(value , tag , tagging , tag _ class) -> OpenSSL :: ASN1 :: Integer - Integer
# to _ bn -> OpenSSL :: BN - OpenSSL
:: ASN1 :: Integer . new(value) -> OpenSSL :: ASN1 :: Integer - OpenSSL
:: ASN1 :: Integer . new(value , tag , tagging , tag _ class) -> OpenSSL :: ASN1 :: Integer
-
OpenSSL
:: ASN1 . # Integer(value) -> OpenSSL :: ASN1 :: Integer (73351.0) -
ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを 生成します。
...ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを
生成します。
OpenSSL::ASN1::Integer.new と同じです。
@param value ASN.1 値を表す Ruby のオブジェクト(OpenSSL::BNのインスタンス)
@param tag タグ番号
@param tagging タグ付けの方法(:IMPLI... -
OpenSSL
:: ASN1 . # Integer(value , tag , tagging , tag _ class) -> OpenSSL :: ASN1 :: Integer (73351.0) -
ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを 生成します。
...ASN.1 の Integer 型の値を表現する Ruby のオブジェクトを
生成します。
OpenSSL::ASN1::Integer.new と同じです。
@param value ASN.1 値を表す Ruby のオブジェクト(OpenSSL::BNのインスタンス)
@param tag タグ番号
@param tagging タグ付けの方法(:IMPLI... -
Integer
# to _ bn -> OpenSSL :: BN (72409.0) -
Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。
...す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class Integer
def to_bn
OpenSSL::BN::n......ew(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i... -
OpenSSL
:: ASN1 :: Integer . new(value) -> OpenSSL :: ASN1 :: Integer (27745.0) -
ASN.1 の Integer 型の値を表現する OpenSSL::ASN1::Integer オブジェクトを 生成します。
...値を表現する OpenSSL::ASN1::Integer オブジェクトを
生成します。
value 以外の引数を省略した場合はタグクラスは :UNIVERSAL、
タグ は OpenSSL::ASN1::INTEGER となります。
@param value ASN.1 値を表す Ruby のオブジェクト(OpenSSL::BNのインス... -
OpenSSL
:: ASN1 :: Integer . new(value , tag , tagging , tag _ class) -> OpenSSL :: ASN1 :: Integer (27745.0) -
ASN.1 の Integer 型の値を表現する OpenSSL::ASN1::Integer オブジェクトを 生成します。
...値を表現する OpenSSL::ASN1::Integer オブジェクトを
生成します。
value 以外の引数を省略した場合はタグクラスは :UNIVERSAL、
タグ は OpenSSL::ASN1::INTEGER となります。
@param value ASN.1 値を表す Ruby のオブジェクト(OpenSSL::BNのインス... -
OpenSSL
:: BN . new(integer) -> OpenSSL :: BN (18697.0) -
整数オブジェクト(Integer)から多倍長整数オブジェクト (OpenSSL::BN)を生成します。
...整数オブジェクト(Integer)から多倍長整数オブジェクト
(OpenSSL::BN)を生成します。
@param integer 整数オブジェクト
@see Integer#to_bn... -
OpenSSL
:: BN # coerce(other) -> Array (18643.0) -
自身と other が同じクラスになるよう、自身か other を変換し [other, self] という配列にして返します。
...換後オブジェクト] にして返します。
それ以外の場合は例外 TypeError を発生させます。
//emlist[][ruby]{
require 'openssl'
p 1.to_bn.coerce(2) # => [2, 1]
//}
@param other 変換の基準となるオブジェクト
@raise TypeError 変換に失敗した場合に発... -
OpenSSL
:: BN # num _ bytes -> Integer (18628.0) -
自身を表現するのに使っているバイト数を返します。
...自身を表現するのに使っているバイト数を返します。
//emlist[][ruby]{
require 'openssl'
p 0.to_bn.num_bytes # => 0
p 255.to_bn.num_bytes # => 1
p 256.to_bn.num_bytes # => 2
p 0b111_11111.to_bn.num_bytes # => 1
p 0b1000_00000.to_bn.num_bytes # => 2
//}... -
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (18379.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
...DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を
OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
複数の ASN.1 の値が含まれている場合、先頭の値だけを返します。
ASN.1 オブジェクトが......-e '
require "openssl"
require "pp"
pem = File.read(ARGV[0])
cert = OpenSSL::X509::Certificate.new(pem)
pp OpenSSL::ASN1.decode(cert.to_der)
' mycert.pem
#<OpenSSL::ASN1::Sequence:0x814e9fc
@tag=16,
@tag_class=:UNIVERSAL,
@tagging=nil,
@value=
[#<OpenSSL::ASN1::Sequence......@tag=16,
@tag_class=:UNIVERSAL,
@tagging=nil,
@value=
[#<OpenSSL::ASN1::ASN1Data:0x814f690
@tag=0,
@tag_class=:CONTEXT_SPECIFIC,
@value=
[#<OpenSSL::ASN1::Integer:0x814f6a4
@tag=2,
@tag_class=:UNIVERSAL,... -
OpenSSL
:: BN . new(str , base=10) -> OpenSSL :: BN (18337.0) -
文字列を多倍長整数オブジェクト(OpenSSL::BN)を生成します。
...文字列を多倍長整数オブジェクト(OpenSSL::BN)を生成します。
base で、変換方法(基数)を指定します。
デフォルトは 10 で、他に 16, 2, 0 を指定できます。
10 引数の文字列を 10進数とみなして、変換します。
16 引数の文字......{
require 'openssl'
OpenSSL::BN.new("-241") # => -241
OpenSSL::BN.new("ff00",16) # => 65280
OpenSSL::BN.new("\x81",2) # => 129
OpenSSL::BN.new("\xff\x81",2) # => 65409
OpenSSL::BN.new("\x00\x00\x00\x02\x00\x81", 0) # => 129
OpenSSL::BN.new("\x00\x00\x00\x02\x80\x81", 0) # => -129
OpenSSL::BN.new(12......を表す文字列
@param base 文字列から整数に変換するときの基数
@raise OpenSSL::BNError 変換に失敗した場合に発生します
反対に、OpenSSL::BN クラスのオブジェクトを文字列にするには、
OpenSSL::BN#to_s を用います。
@see OpenSSL::BN#to_s... -
OpenSSL
:: BN . new(bn) -> OpenSSL :: BN (18322.0) -
OpenSSL::BN を複製して返します。
...
OpenSSL::BN を複製して返します。
@param bn 複製する OpenSSL::BN オブジェクト... -
OpenSSL
:: BN # num _ bits -> Integer (9628.0) -
自身を表現するのに使っているビット数を返します。
...自身を表現するのに使っているビット数を返します。
符号は無視されます。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new("127").num_bits # => 7
OpenSSL::BN.new("-127").num_bits # => 7
OpenSSL::BN.new("128").num_bits # => 8
//}... -
OpenSSL
:: ASN1 (9097.0) -
ASN.1(Abstract Syntax Notation One) のデータを取り扱うためのモジュールです。
...ASN.1(Abstract Syntax Notation One)
のデータを取り扱うためのモジュールです。
OpenSSLで証明書などを取り扱うのに必要になります。
このモジュールには、ASN.1関連のモジュール関数や定数、
ASN.1 のデータ型に対応するクラスが定......において、
ASN.1 のデータ型は OpenSSL::ASN1::ASN1Data および
そのサブクラスにマップされています。
ASN.1 の単純型(simple type)は OpenSSL::ASN1::Primitive の
各サブクラスに、構造型(structured type)は OpenSSL::ASN1::Constructive
の各サブクラス......タグクラスは UNIVERSAL です。
その値は OpenSSL::ASN1::ASN1Data#value で取り出せます。
単純型は通常の Ruby のオブジェクト、構造型は配列
UNIVERSAL以外のタグクラスを付けられた型は、
OpenSSL::ASN1::ASN1Data に対応します。UNIVERSAL以外...