Package org.keycloak.crypto
Class CryptoUtils
java.lang.Object
org.keycloak.crypto.CryptoUtils
Utility class for common cryptographic operations and algorithm discovery.
- Author:
- Forkim Akwichek
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.keycloak.crypto.SignatureProvidergetSignatureProvider(org.keycloak.models.KeycloakSession session, String algorithm) Looks up aSignatureProviderfor the given algorithm, throwing if none is registered.getSupportedAsymmetricEncryptionAlgorithms(org.keycloak.models.KeycloakSession session) Returns the supported asymmetric encryption algorithms.getSupportedAsymmetricSignatureAlgorithms(org.keycloak.models.KeycloakSession session) Returns the supported asymmetric signature algorithms.
-
Constructor Details
-
CryptoUtils
public CryptoUtils()
-
-
Method Details
-
getSignatureProvider
public static org.keycloak.crypto.SignatureProvider getSignatureProvider(org.keycloak.models.KeycloakSession session, String algorithm) throws org.keycloak.common.VerificationException Looks up aSignatureProviderfor the given algorithm, throwing if none is registered.- Throws:
org.keycloak.common.VerificationException
-
getSupportedAsymmetricSignatureAlgorithms
public static List<String> getSupportedAsymmetricSignatureAlgorithms(org.keycloak.models.KeycloakSession session) Returns the supported asymmetric signature algorithms. This method discovers all available SignatureProvider implementations and filters for those that support asymmetric algorithms (RSA, EC, EdDSA, etc.).- Parameters:
session- The Keycloak session- Returns:
- List of asymmetric signature algorithm names
-
getSupportedAsymmetricEncryptionAlgorithms
public static List<String> getSupportedAsymmetricEncryptionAlgorithms(org.keycloak.models.KeycloakSession session) Returns the supported asymmetric encryption algorithms. This method discovers all available Keys and filters for those that use asymmetric algorithms (RSA, EC, EdDSA, etc.).- Parameters:
session- The Keycloak session- Returns:
- List of asymmetric encryption algorithm names
-