File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 3232import org .bouncycastle .crypto .engines .RSABlindedEngine ;
3333import org .bouncycastle .crypto .params .ParametersWithRandom ;
3434import org .bouncycastle .crypto .params .RSAKeyParameters ;
35- import org .bouncycastle .crypto .params .RSAPrivateCrtKeyParameters ;
3635import org .bouncycastle .crypto .tls .TlsRsaKeyExchange ;
3736import org .bouncycastle .jcajce .provider .asymmetric .util .BaseCipherSpi ;
3837import org .bouncycastle .jcajce .provider .util .BadBlockException ;
@@ -335,10 +334,11 @@ else if (key instanceof RSAPrivateKey)
335334 }
336335 else if (params instanceof TLSRSAPremasterSecretParameterSpec )
337336 {
338- if (!(param instanceof RSAPrivateCrtKeyParameters ))
337+ if (!(param instanceof RSAKeyParameters ) || !(( RSAKeyParameters ) param ). isPrivate ( ))
339338 {
340339 throw new InvalidKeyException ("RSA private key required for TLS decryption" );
341340 }
341+
342342 this .tlsRsaSpec = (TLSRSAPremasterSecretParameterSpec )params ;
343343 }
344344 }
You can’t perform that action at this time.
0 commit comments