るりまサーチ

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

別のキーワード

  1. tracer add_filter
  2. logger add
  3. rexml/document add
  4. socket ip_add_membership

ライブラリ

検索結果

OpenSSL::X509::ExtensionFactory (11053.0)

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

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



require 'openssl'
# ca_cert: CA の証明書オブジェクト
# req: CSR オブジェクト
# newcert: 新たに生成する証明書のオブジェクト
ca_cert = OpenSSL::X509::Certificate.new(File.read...
...('ca_cert.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"))...