Skip to content

Commit

Permalink
[test] borrow some more DSA test from MRI's suite
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Dec 6, 2024
1 parent 4193da0 commit 8825032
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/ruby/dsa/test_dsa.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ def setup
super
end

def test_private
key = Fixtures.pkey("dsa1024")
assert_equal true, key.private?
key2 = OpenSSL::PKey::DSA.new(key.to_der)
assert_equal true, key2.private?
key3 = key.public_key
assert_equal false, key3.private?
key4 = OpenSSL::PKey::DSA.new(key3.to_der)
assert_equal false, key4.private?
end

def test_new
key = OpenSSL::PKey::DSA.new(2048)
pem = key.public_key.to_pem
OpenSSL::PKey::DSA.new pem
end

def test_dup
key = Fixtures.pkey("dsa1024")
key2 = key.dup
Expand Down

0 comments on commit 8825032

Please sign in to comment.