public String toString() { StringBuffer buf = new StringBuffer(); String nl = Strings.lineSeparator(); buf.append("RSA Private Key [").append( RSAUtil.generateKeyFingerprint(this.getModulus())).append("],[]").append(nl); buf.append(" modulus: ").append(this.getModulus().toString(16)).append(nl); return buf.toString(); } }
public int hashCode() { return getModulus().hashCode() ^ getPrivateExponent().hashCode(); }
public boolean equals(Object o) { if (!(o instanceof RSAPrivateKey)) { return false; } if (o == this) { return true; } RSAPrivateKey key = (RSAPrivateKey)o; return getModulus().equals(key.getModulus()) && getPrivateExponent().equals(key.getPrivateExponent()); }
public byte[] getEncoded() { return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, DERNull.INSTANCE), new org.bouncycastle.asn1.pkcs.RSAPrivateKey(getModulus(), ZERO, getPrivateExponent(), ZERO, ZERO, ZERO, ZERO, ZERO)); }