...
Code Block | ||
---|---|---|
| ||
private static boolean keysEqual(Key key1, Key key2) {
if (key1.equals(key2)) {
return true;
}
return false;
}
|
Compliant Solution
This compliant solution uses the equals()
method as a first test and then compares the encoded version of the keys to facilitate provider-independent behavior. It checks whether an RSAPrivateKey
and an RSAPrivateCrtKey
represent equivalent private keys [Sun 2006].
...