るりまサーチ

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

別のキーワード

  1. readline basic_quote_characters
  2. readline basic_quote_characters=
  3. readline basic_word_break_characters
  4. readline basic_word_break_characters=
  5. openssl basic

ライブラリ

検索結果

OpenSSL::OCSP::BasicResponse#add_nonce(val=nil) -> self (32107.0)

BasicResponse に nonce を追加します。

...BasicResponse に nonce を追加します。

引数を省略すると、ランダムな nonce を生成し利用します。

通常はこのメソッドを使わず OpenSSL::OCSP::BasicResponse#copy_nonce を
用います。

@param val 追加する nonce の値(文字列)...

OpenSSL::OCSP (11096.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...
...tatus != 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, exts = basic_resp.s...