@JRubyMethod(name = "pub_key") public synchronized IRubyObject get_pub_key() { DSAPublicKey key; BigInteger param; if ((key = this.pubKey) != null) { return BN.newBN(getRuntime(), key.getY()); } else if (specValues != null) { if ((param = specValues[SPEC_Y]) != null) { return BN.newBN(getRuntime(), param); } } return getRuntime().getNil(); }
@JRubyMethod(name = "g") public synchronized IRubyObject get_g() { // FIXME: return only for public? DSAKey key; BigInteger param; if ((key = this.pubKey) != null || (key = this.privKey) != null) { if ((param = key.getParams().getG()) != null) { return BN.newBN(getRuntime(), param); } } else if (specValues != null) { if ((param = specValues[SPEC_G]) != null) { return BN.newBN(getRuntime(), param); } } return getRuntime().getNil(); }
@JRubyMethod(name = "priv_key") public synchronized IRubyObject get_priv_key() { DSAPrivateKey key; BigInteger param; if ((key = this.privKey) != null) { return BN.newBN(getRuntime(), key.getX()); } return getRuntime().getNil(); }