36件ヒット
[1-36件を表示]
(0.218秒)
検索結果
先頭3件
-
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (18113.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
...:
ruby -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... -
OpenSSL
:: ASN1 :: ASN1Data # to _ der -> String (18107.0) -
ASN.1 値の DER 表現を返します。
...ASN.1 値の DER 表現を返します。
@see OpenSSL::ASN1.#decode... -
OpenSSL
:: ASN1 (108.0) -
ASN.1(Abstract Syntax Notation One) のデータを取り扱うためのモジュールです。
...false, 3, :IMPLICIT, :APPLICATION)
# to_der でエンコード
x.to_der # => "\f\x06foobar"
y.to_der # => "0\x06\x01\x01\xFF\x02\x01\xF4"
z.to_der # => "b\x03\x01\x01\x00"
z2.to_der # => "b\x03\x01\x01\x00" これは z.to_der と同じ
u.to_der # => "C\x01\x00"
# エンコード......した文字列をデコード
OpenSSL::ASN1.decode(x.to_der)
# => #<OpenSSL::ASN1::UTF8String:0x000000027cc700 @tag=12, @value="foobar", @tagging=nil, @tag_class=:UNIVERSAL>
OpenSSL::ASN1.decode(y.to_der)
# => #<OpenSSL::ASN1::Sequence:0x000000027c47d0 @tag=16, @value=[#<OpenSSL::ASN1::Bool......=:UNIVERSAL>
OpenSSL::ASN1.decode(z.to_der)
# => #<OpenSSL::ASN1::ASN1Data:0x000000027bc918 @tag=2, @value=[#<OpenSSL::ASN1::Boolean:0x000000027bc968 @tag=1, @value=false, @tagging=nil, @tag_class=:UNIVERSAL>], @tag_class=:APPLICATION>
OpenSSL::ASN1.decode(u.to_der)
# => #<OpenSSL::ASN1::ASN...