Package org.keycloak.common.crypto
Interface CryptoProvider
- 
 public interface CryptoProviderAbstraction to handle differences between the APIs for non-fips and fips mode- Author:
- Marek Posolda
 
- 
- 
Method Summary
 
- 
- 
- 
Method Detail- 
getBouncyCastleProviderProvider getBouncyCastleProvider() - Returns:
- BouncyCastle security provider. Can be either non-FIPS or FIPS based provider
 
 - 
getAlgorithmProvider<T> T getAlgorithmProvider(Class<T> clazz, String algorithm) Get some algorithm provider implementation. Returned implementation can be dependent according to if we have non-fips bouncycastle or fips bouncycastle on the classpath.- Parameters:
- clazz- Returned class.
- algorithm- Type of the algorithm, which we want to return
- Returns:
 
 - 
getCertificateUtilsCertificateUtilsProvider getCertificateUtils() Get CertificateUtils implementation. Returned implementation can be dependent according to if we have non-fips bouncycastle or fips bouncycastle on the classpath.- Returns:
 
 - 
getPemUtilsPemUtilsProvider getPemUtils() Get PEMUtils implementation. Returned implementation can be dependent according to if we have non-fips bouncycastle or fips bouncycastle on the classpath.- Returns:
 
 - 
getOCSPProver<T> T getOCSPProver(Class<T> clazz) 
 - 
getIdentityExtractorProviderUserIdentityExtractorProvider getIdentityExtractorProvider() 
 - 
getEcdsaCryptoProviderECDSACryptoProvider getEcdsaCryptoProvider() 
 - 
createECParamsECParameterSpec createECParams(String curveName) Create the param spec for the EC curve- Parameters:
- curveName-
- Returns:
 
 - 
getKeyPairGenKeyPairGenerator getKeyPairGen(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException 
 - 
getKeyFactoryKeyFactory getKeyFactory(String algorithm) throws NoSuchAlgorithmException, NoSuchProviderException 
 - 
getAesCbcCipherCipher getAesCbcCipher() throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException 
 - 
getAesGcmCipherCipher getAesGcmCipher() throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException 
 - 
getSecretKeyFactSecretKeyFactory getSecretKeyFact(String keyAlgorithm) throws NoSuchAlgorithmException, NoSuchProviderException 
 - 
getKeyStoreKeyStore getKeyStore(KeystoreUtil.KeystoreFormat format) throws KeyStoreException, NoSuchProviderException 
 - 
getSupportedKeyStoreTypesdefault Stream<KeystoreUtil.KeystoreFormat> getSupportedKeyStoreTypes() - Returns:
- Keystore types/algorithms supported by this CryptoProvider
 
 - 
getX509CertFactoryCertificateFactory getX509CertFactory() throws CertificateException, NoSuchProviderException 
 - 
getCertStoreCertStore getCertStore(CollectionCertStoreParameters collectionCertStoreParameters) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException 
 - 
getCertPathBuilderCertPathBuilder getCertPathBuilder() throws NoSuchAlgorithmException, NoSuchProviderException 
 - 
getSignatureSignature getSignature(String sigAlgName) throws NoSuchAlgorithmException, NoSuchProviderException 
 - 
wrapFactoryForTruststoreSSLSocketFactory wrapFactoryForTruststore(SSLSocketFactory delegate) Wrap given SSLSocketFactory and decorate it with some additional functionality. This method is used in the context of truststore (where Keycloak is SSL client)- Parameters:
- delegate- The original factory to wrap. Usually default java SSLSocketFactory
- Returns:
- decorated factory
 
 - 
getSupportedRsaKeySizesdefault String[] getSupportedRsaKeySizes() - Returns:
- Allowed key sizes of RSA key modulus, which this cryptoProvider supports
 
 
- 
 
-