1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* sample/openssl/gen_csr.rb: there (at least) is a CA which does not accept DN

in UTF8STRING format.  it's a sample.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nahi 2003-11-05 14:55:52 +00:00
parent ea03c3fc2c
commit cc2343e7b7
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed Nov 5 23:49:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
* sample/openssl/gen_csr.rb: there (at least) is a CA which does not
accept DN in UTF8STRING format. it's a sample.
Wed Nov 5 22:55:16 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* configure.in, eval.c, signal.c: : add '--with-pthread-ext'

View file

@ -25,11 +25,11 @@ $stdout.sync = true
name_ary = name_str.scan(/\s*([^\/,]+)\s*/).collect { |i| i[0].split("=") }
p name_ary
name = X509::Name.new(name_ary)
name = X509::Name.new(name_ary, OpenSSL::ASN1::PRINTABLESTRING)
keypair = nil
if keypair_file
keypair = PKey::RSA.new(File.read(keypair_file))
keypair = PKey::RSA.new(File.open(keypair_file).read)
else
keypair = PKey::RSA.new(1024) { putc "." }
puts
@ -42,9 +42,10 @@ end
puts "Generating CSR for #{name_ary.inspect}"
req = X509::Request.new
req.version = 0
req.subject = name
req.public_key = keypair.public_key
req.sign(keypair, Digest::SHA1.new)
req.sign(keypair, Digest::MD5.new)
puts "Writing #{csrout}..."
File.open(csrout, "w") do |f|