mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue