Sha256: 8c33bf6e7815a636bc235303fca386c3d9830a9ce20be890db5690c0e8443436
Contents?: true
Size: 918 Bytes
Versions: 11
Compression:
Stored size: 918 Bytes
Contents
require 'mechanize/test_case' class TestMechanizeFormKeygen < Mechanize::TestCase def setup super keygen = node('keygen', 'name' => 'userkey', 'challenge' => 'f4832e1d200df3df8c5c859edcabe52f') @keygen = Mechanize::Form::Keygen.new keygen end def test_challenge assert_equal "f4832e1d200df3df8c5c859edcabe52f", @keygen.challenge end def test_key assert @keygen.key.kind_of?(OpenSSL::PKey::PKey), "Not an OpenSSL key" assert @keygen.key.private?, "Not a private key" end def test_spki_signature skip("JRuby PKI doesn't handle this for reasons I've been unable to understand") if RUBY_ENGINE=~/jruby/ spki = OpenSSL::Netscape::SPKI.new @keygen.value assert_equal @keygen.challenge, spki.challenge assert_equal @keygen.key.public_key.to_pem, spki.public_key.to_pem assert spki.verify(@keygen.key.public_key) end end
Version data entries
11 entries across 11 versions & 1 rubygems