From: Martin Bosslet Date: 2011-11-09T02:47:52+09:00 Subject: [ruby-core:40854] [ruby-trunk - Bug #5600][Assigned] OpenSSL::X509::Request can't sign() an OpenSSL::PKey::EC Issue #5600 has been updated by Martin Bosslet. Status changed from Open to Assigned Assignee set to Martin Bosslet Target version set to 2.0.0 ---------------------------------------- Bug #5600: OpenSSL::X509::Request can't sign() an OpenSSL::PKey::EC http://redmine.ruby-lang.org/issues/5600 Author: Steve Caligo Status: Assigned Priority: Normal Assignee: Martin Bosslet Category: ext Target version: 2.0.0 ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] Unlike the PKey::DSA and PKey::RSA classes, PKey::EC provides a private_key?() rather than private?() method and is thus incompatible with the other OpenSSL classes that rely on them, i.e. it makes impossible to generate a certificate signing request: key = OpenSSL::PKey::EC.new('secp521r1') key.generate_key req = OpenSSL::X509::Request.new req.public_key = key req.subject = OpenSSL::X509::Name.parse('CN=whatever') req.sign(key, OpenSSL::Digest::SHA384.new) which produces the error: in `sign': undefined method `private?' for # (NoMethodError) ossl_pkey_ec.c should either: - rb_define_method() the missing private? and public? methods - rename public_key? to public? and private_key? to private? Judging by the source code, this should be present in branch 1.8 as well. -- http://redmine.ruby-lang.org