22件ヒット
[1-22件を表示]
(0.035秒)
検索結果
-
OpenSSL
:: ASN1 (175.0) -
ASN.1(Abstract Syntax Notation One) のデータを取り扱うためのモジュールです。
...tring.new("foobar")
# 構造型のデータ
y = OpenSSL::ASN1::Sequence.new([OpenSSL::ASN1::Boolean.new(true),
OpenSSL::ASN1::Integer.new(-12)])
# APPLICATION タグクラスのタグ2番でタグ付けられたデータ
z = OpenSSL::ASN1::ASN1Data.new([Open......SSL::ASN1::Boolean.new(false)],
2, :APPLICATION)
# 上と同様のデータを OpenSSL::ASN1::Boolean.new の2番目以降の
# 引数で表現する
z2 = OpenSSL::ASN1::Boolean.new(false, 2, :EXPLICIT, :APPLICATION)
# IMPLICIT なタグ付けをする
u......= OpenSSL::ASN1::Boolean.new(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\x... -
OpenSSL
:: OCSP (31.0) -
OCSP(Online Certificate Status Protocol)を取り扱うための モジュールです。OCSP は 2560 で定義されています。
...ト)
store # 信頼している証明書ストア
cid = OpenSSL::OCSP::CertificateId.new(subject, issuer)
req = OpenSSL::OCSP::Request.new
req.add_certid(cid)
req.add_nonce
http = Net::HTTP.new('ocsp.example.com', 80)
httpres = http.post("/", req.to_der, 'content-type' => 'applicati......on/ocsp-request')
raise "HTTP error" if !httpres.kind_of?(Net::HTTPOK)
res = OpenSSL::OCSP::Response.new(httpres.body)
puts "Response status: #{res.status_string}"
exit if res.status != OpenSSL::OCSP::RESPONSE_STATUS_SUCCESSFUL
basic_resp = res.basic
raise "nonce error" unless [-1, 1......SAGE[status]}"
puts "reason: #{reason}" if status == OpenSSL::OCSP::V_CERTSTATUS_REVOKED
puts "revoked time: #{revtime}" if status == OpenSSL::OCSP::V_CERTSTATUS_REVOKED
puts "response update: #{thisupd}"
puts "response next update: #{nextupd}"
puts "extensions: "
exts.each{|ext| p ext}...