8318340: Improve RSA key implementations

Reviewed-by: rhalade, mschoene, valeriep, mullan
This commit is contained in:
Weijun Wang 2023-10-27 00:29:20 +00:00 committed by Jaikiran Pai
parent 2885469c4b
commit 0203c7e612
6 changed files with 34 additions and 43 deletions

View file

@ -301,14 +301,6 @@ public final class RSAPrivateCrtKeyImpl
return keyParams;
}
// return a string representation of this key for debugging
@Override
public String toString() {
return "SunRsaSign " + type.keyAlgo + " private CRT key, "
+ n.bitLength() + " bits" + "\n params: " + keyParams
+ "\n modulus: " + n + "\n private exponent: " + d;
}
// utility method for parsing DER encoding of RSA private keys in PKCS#1
// format as defined in RFC 8017 Appendix A.1.2, i.e. SEQ of version, n,
// e, d, p, q, pe, qe, and coeff, and return the parsed components.

View file

@ -138,14 +138,6 @@ public final class RSAPrivateKeyImpl extends PKCS8Key implements RSAPrivateKey {
return keyParams;
}
// return a string representation of this key for debugging
@Override
public String toString() {
return "Sun " + type.keyAlgo + " private key, " + n.bitLength()
+ " bits" + "\n params: " + keyParams + "\n modulus: " + n
+ "\n private exponent: " + d;
}
/**
* Restores the state of this object from the stream.
* <p>