提交 62bda385 编写于 作者: V valeriep

8204152: SignedObject throws NullPointerException for null keys with an...

8204152: SignedObject throws NullPointerException for null keys with an initialized Signature object
Summary: Check for null and throw InvalidKeyException to maintain same behavior
Reviewed-by: xuelei
上级 e8b89549
......@@ -115,6 +115,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)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册