るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.172秒)
トップページ > クエリ:i[x] > クエリ:l[x] > クエリ:cert[x] > クエリ:add_extension[x]

別のキーワード

  1. openssl cert
  2. webrick/https server_cert
  3. webrick/https client_cert
  4. store add_cert
  5. sslcontext cert=

ライブラリ

検索結果

OpenSSL::X509::Certificate#add_extension(ext) -> OpenSSL::X509::Extension (30401.0)

拡張領域に拡張を追加します。

...拡張領域に拡張を追加します。

@return 追加した拡張を返します
@param ext 追加する拡張(OpenSSL::X509::Extension オブジェクト)
@raise OpenSSL::X509::CertificateError 設定に失敗した場合に発生します...

OpenSSL::X509::ExtensionFactory (9030.0)

OpenSSL::X509::Extension を簡便に生成するための クラスです。

...OpenSSL::X509::Extension を簡便に生成するための
クラスです。



require 'openssl'
# ca_cert: CA の証明書オブジェクト
# req: CSR オブジェクト
# newcert: 新たに生成する証明書のオブジェクト
ca_cert = OpenSSL::X509::Certificate.new(File.read...
...t.pem'))
req = OpenSSL::X509::Request.new(File.read('req.pem'))
newcert = OpenSSL::X509::Certificate.new
# 新しい ExtensionFactory オブジェクトを生成し、 CA の証明書オブジェクト
# を設定
factory = OpenSSL::X509::ExtensionFactory.new(ca_cert)
# CSR オブジェ...
...p factory.create_extension("authorityKeyIdentifier", "keyid,issuer:always")
# => authorityKeyIdentifier = keyid:D1:AB:87:....

# 生成した拡張領域オブジェクトを証明書の拡張領域に追加
newcert.add_extension(factory.create_extension("basicConstraints", "CA:FALSE"))...