8204152: SignedObject throws NullPointerException for null keys with an initialized Signature object
Check for null and throw InvalidKeyException to maintain same behavior Reviewed-by: xuelei
This commit is contained in:
parent
6f462fbc70
commit
8e127e5c26
@ -114,6 +114,9 @@ public class RSAKeyFactory extends KeyFactorySpi {
|
||||
* Used by RSASignature and RSACipher.
|
||||
*/
|
||||
public static RSAKey toRSAKey(Key key) throws InvalidKeyException {
|
||||
if (key == null) {
|
||||
throw new InvalidKeyException("Key must not be null");
|
||||
}
|
||||
if ((key instanceof RSAPrivateKeyImpl) ||
|
||||
(key instanceof RSAPrivateCrtKeyImpl) ||
|
||||
(key instanceof RSAPublicKeyImpl)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user