るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.016秒)
トップページ > クエリ:reason[x] > ライブラリ:openssl[x]

別のキーワード

  1. drb reason
  2. _builtin reason
  3. optparse reason
  4. optparse reason=
  5. parseerror reason

キーワード

検索結果

OpenSSL::OCSP::BasicResponse#add_status(cid, status, reason, revtime, thisupd, nextupd, exts) -> self (109.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 オブジェクトの配列)...

OpenSSL::OCSP (20.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...
...ng}"
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 response fail"
end
rescid, status, reason, revtime, thisupd, nextupd,...

OpenSSL::OCSP::BasicResponse#status -> [[OpenSSL::OCSP::CertificateId, Integer, Integer, Time|nil, Time, Time|nil, [OpenSSL::X509::Extension]]] (8.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...
...例:
res.basic.status
# => [
# [#<OpenSSL::OCSP::CertificateId:0x00000000e3c290>, # certificate ID
# 0, # status code
# 0, # reason code
# nil,...