るりまサーチ

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

別のキーワード

  1. rsa new
  2. rsa to_pem
  3. rsa to_s
  4. rsa export
  5. rsa generate

ライブラリ

クラス

検索結果

OpenSSL::PKey::RSA#to_text -> String (24101.0)

鍵を人間が読める形式に変換します。

鍵を人間が読める形式に変換します。

OpenSSL::PKey::RSA (21106.0)

RSA 暗号鍵のクラスです。

...RSA 暗号鍵のクラスです。

通常このクラスで利用するのは、
OpenSSL::PKey::RSA.generate, OpenSSL::PKey::RSA.new,
OpenSSL::PKey::RSA#public?, OpenSSL::PKey::RSA#private?,
OpenSSL::PKey::RSA#public_key, OpenSSL::PKey::RSA#to_text,
OpenSSL::PKey::RSA#to_pem, OpenSSL::PKey::RSA#to_...
...ソッドを利用するときは
RSA
についてよく理解し、必要な場合のみにすべきです。


例:
require 'openssl'

# initialize random seed
OpenSSL::Random.seed(File.read("/dev/random", 16))
# 鍵対を生成
rsa
= OpenSSL::PKey::RSA.generate(2048)
# 秘密鍵をAES...
...e = "!secret passphrase!"
File.open("private_key.pem", "w") do |f|
f.write(rsa.export(OpenSSL::Cipher.new("aes256"), passphrase))
end
# 公開鍵をpublic_key.pemに保存
public_key = rsa.public_key
File.open("public_key.pem", "w") do |f|
f.write(public_key.export)
end

#...

openssl (6012.0)

OpenSSL(https://www.openssl.org/) を Ruby から扱うためのライブラリです。

...OpenSSL(https://www.openssl.org/)
を Ruby から扱うためのライブラリです。

このドキュメントでは SSL/TLS の一般的事項については
解説をしません。利用者は、SSL/TLSの各概念、例えば
以下の事項について理解している必要があります...
...名です。

require 'openssl'

key = OpenSSL::PKey::RSA.new(1024)
digest = OpenSSL::Digest::SHA1.new()

issu = sub = OpenSSL::X509::Name.new()
sub.add_entry('C', 'JP')
sub.add_entry('ST', 'Shimane')
sub.add_entry('CN', 'Ruby Taro')

cer = OpenSSL::X509::Certificate.new()
ce...
...r.public_key = key # <= 署名する対象となる公開鍵
cer.serial = 1
cer.issuer = issu
cer.subject = sub

cer.sign(key, digest) # <= 署名するのに使う秘密鍵とハッシュ関数
print cer.to_text

===[a:references] 参考文献
* 5246
* Eric Rescorla. SSL and TLS :...