File tree 1 file changed +2
-2
lines changed
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 32
32
import org .bouncycastle .crypto .engines .RSABlindedEngine ;
33
33
import org .bouncycastle .crypto .params .ParametersWithRandom ;
34
34
import org .bouncycastle .crypto .params .RSAKeyParameters ;
35
- import org .bouncycastle .crypto .params .RSAPrivateCrtKeyParameters ;
36
35
import org .bouncycastle .crypto .tls .TlsRsaKeyExchange ;
37
36
import org .bouncycastle .jcajce .provider .asymmetric .util .BaseCipherSpi ;
38
37
import org .bouncycastle .jcajce .provider .util .BadBlockException ;
@@ -335,10 +334,11 @@ else if (key instanceof RSAPrivateKey)
335
334
}
336
335
else if (params instanceof TLSRSAPremasterSecretParameterSpec )
337
336
{
338
- if (!(param instanceof RSAPrivateCrtKeyParameters ))
337
+ if (!(param instanceof RSAKeyParameters ) || !(( RSAKeyParameters ) param ). isPrivate ( ))
339
338
{
340
339
throw new InvalidKeyException ("RSA private key required for TLS decryption" );
341
340
}
341
+
342
342
this .tlsRsaSpec = (TLSRSAPremasterSecretParameterSpec )params ;
343
343
}
344
344
}
You can’t perform that action at this time.
0 commit comments