るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. time rfc2822
  2. time iso8601
  3. time httpdate
  4. time parse
  5. time strptime

モジュール

キーワード

検索結果

OpenSSL::OCSP (54391.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...

OpenSSL::OCSP::NOTIME -> Integer (27355.0)

OCSP 応答の生成時刻を正しく設定しないことを意味します。

OCSP 応答の生成時刻を正しく設定しないことを意味します。

OpenSSL::OCSP::BasicResponse#status -> [[OpenSSL::OCSP::CertificateId, Integer, Integer, Time|nil, Time, Time|nil, [OpenSSL::X509::Extension]]] (10525.0)

証明書の状態の問い合わせの結果を返します。

...値を取ります
* OpenSSL::OCSP::V_CERTSTATUS_GOOD 正常
* OpenSSL::OCSP::V_CERTSTATUS_REVOKED 失効
* OpenSSL::OCSP::V_CERTSTATUS_UNKNOWN 不明

失効理由コードは以下のいずれかを返します。
* OpenSSL::OCSP::REVOKED_STATUS_NOSTATUS
* OpenSSL::OCSP::REVOKED_STATUS_...
...TUS_KEYCOMPROMISE
* OpenSSL::OCSP::REVOKED_STATUS_CACOMPROMISE
* OpenSSL::OCSP::REVOKED_STATUS_AFFILIATIONCHANGED
* OpenSSL::OCSP::REVOKED_STATUS_SUPERSEDED
* OpenSSL::OCSP::REVOKED_STATUS_CESSATIONOFOPERATION
* OpenSSL::OCSP::REVOKED_STATUS_CERTIFICATEHOLD
* OpenSSL::OCSP::REVOKED_STATU...
...を返します。

拡張領域には、OpenSSL::X509::Extension の配列が渡されます。

結果をどのように解釈すべきか、より詳しくは 2560 や X.509 を見てください。

例:
res.basic.status
# => [
# [#<OpenSSL::OCSP::CertificateId:0x00000000e3c290>, #...

OpenSSL::OCSP::BasicResponse#add_status(cid, status, reason, revtime, thisupd, nextupd, exts) -> self (9397.0)

証明書の状態の問い合わせの結果をオブジェクトに追加します。

...明書の状態の問い合わせの結果をオブジェクトに追加します。

詳しくは OpenSSL::OCSP::BasicResponse#status を見てください。

@param cid 問い合わせの(OpenSSL::OCSP::CertificateId オブジェクト)
@param status ステータスコード(整数)
@param reason...
...失効理由コード(整数)
@param revtime 失効時刻(Time オブジェクトもしくは nil)
@param thisupd 最終更新時刻(Time オブジェクト)
@param nextupd 次回更新時刻(Time オブジェクト)
@param exts 拡張領域(OpenSSL::X509::Extension オブジェクトの配列)...