Widening cast for BCProvider for existing provider (#14202)
Closes #14210
This commit is contained in:
parent
19d69169b1
commit
68a07465a6
1 changed files with 2 additions and 2 deletions
|
@ -22,13 +22,13 @@ import org.keycloak.common.crypto.UserIdentityExtractorProvider;
|
||||||
*/
|
*/
|
||||||
public class DefaultCryptoProvider implements CryptoProvider {
|
public class DefaultCryptoProvider implements CryptoProvider {
|
||||||
|
|
||||||
private final BouncyCastleProvider bcProvider;
|
private final Provider bcProvider;
|
||||||
|
|
||||||
private Map<String, Object> providers = new ConcurrentHashMap<>();
|
private Map<String, Object> providers = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public DefaultCryptoProvider() {
|
public DefaultCryptoProvider() {
|
||||||
// Make sure to instantiate this only once due it is expensive. And skip registration if already available in Java security providers (EG. due explicitly configured in java security file)
|
// Make sure to instantiate this only once due it is expensive. And skip registration if already available in Java security providers (EG. due explicitly configured in java security file)
|
||||||
BouncyCastleProvider existingBc = (BouncyCastleProvider) Security.getProvider(CryptoConstants.BC_PROVIDER_ID);
|
Provider existingBc = Security.getProvider(CryptoConstants.BC_PROVIDER_ID);
|
||||||
this.bcProvider = existingBc == null ? new BouncyCastleProvider() : existingBc;
|
this.bcProvider = existingBc == null ? new BouncyCastleProvider() : existingBc;
|
||||||
|
|
||||||
providers.put(CryptoConstants.A128KW, new AesKeyWrapAlgorithmProvider());
|
providers.put(CryptoConstants.A128KW, new AesKeyWrapAlgorithmProvider());
|
||||||
|
|
Loading…
Reference in a new issue