2件ヒット
[1-2件を表示]
(0.075秒)
検索結果
-
OpenSSL
:: ASN1 (34216.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以外... -
OpenSSL
:: OCSP (33262.0) -
OCSP(Online Certificate Status Protocol)を取り扱うための モジュールです。OCSP は 2560 で定義されています。
...示する
require 'openssl'
require 'net/http'
# ...
subject # 問い合わせ対象の証明書(Certificate オブジェクト)
issuer # subject の発行者の証明書(Certificate オブジェクト)
store # 信頼している証明書ストア
cid = OpenSSL::OCSP::CertificateId.new......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' => 'application/ocsp-request')
raise "HTTP error" if !httpres.kind_of?(Net::HTTPOK)
res = OpenSSL::OCSP::Respon......se.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].include?(req.check_nonce(basic_resp))
unless basic_resp.verify([], store)
puts "verify respons...