diff --git a/lib/jopenssl/_compat23.rb b/lib/jopenssl/_compat23.rb index 978a8ce0..f2a61c29 100644 --- a/lib/jopenssl/_compat23.rb +++ b/lib/jopenssl/_compat23.rb @@ -25,16 +25,6 @@ def set_pqg(p, q, g) end - class DSA - - def set_key(pub_key, priv_key) - self.pub_key = pub_key - self.priv_key = priv_key - self - end - - end - end end diff --git a/src/main/java/org/jruby/ext/openssl/PKeyDSA.java b/src/main/java/org/jruby/ext/openssl/PKeyDSA.java index 53acd197..aebd1e68 100644 --- a/src/main/java/org/jruby/ext/openssl/PKeyDSA.java +++ b/src/main/java/org/jruby/ext/openssl/PKeyDSA.java @@ -512,6 +512,14 @@ public IRubyObject set_pqg(IRubyObject p, IRubyObject q, IRubyObject g) { return this; } + @JRubyMethod + public IRubyObject set_key(final ThreadContext context, IRubyObject pub_key, IRubyObject priv_key) { + this.dsa_y = BN.getBigInteger(pub_key); + this.dsa_x = BN.getBigInteger(priv_key); + generateKeyInternal(); + return this; + } + @JRubyMethod(name = "priv_key") public synchronized IRubyObject get_priv_key() { DSAPrivateKey key;