Package es.gob.afirma.tsl.utils
Class UtilsProviders
- java.lang.Object
-
- es.gob.afirma.tsl.utils.UtilsProviders
-
public final class UtilsProviders extends java.lang.ObjectUtilities class for manage the cryptographic providers.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.3, 19/09/2022.
-
-
Field Summary
Fields Modifier and Type Field Description static java.security.ProviderBC_PROVIDERConstant attribute that represents the BC Provider.static java.lang.StringBC_PROVIDER_TOKEN_NAMEConstant attribute that represents the string to identify the name of the Bouncy Castle Provider.static java.lang.StringSEED_ALGORITHM_SHA1PRNGConstant attribute that represents the token name-id for the seed algorithm SHA1-PRNG.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.SecureRandomgetSecureRandomForSeedAlgorithmProvider(java.lang.String algNameSecRandom, java.security.Provider prov)Gets the secure random used for the input seed algorithm in the input provider.static java.security.SecureRandomgetSecureRandomForSeedAlgorithmProviderName(java.lang.String algNameSecRandom, java.lang.String provName)Gets the secure random used for the input seed algorithm in the input provider.static voidinitializeProviders()Method that initializes the providers.static voidresetAllSecureRandomCache()Reset the seed algorithm generator cache.
-
-
-
Field Detail
-
SEED_ALGORITHM_SHA1PRNG
public static final java.lang.String SEED_ALGORITHM_SHA1PRNG
Constant attribute that represents the token name-id for the seed algorithm SHA1-PRNG.- See Also:
- Constant Field Values
-
BC_PROVIDER
public static final java.security.Provider BC_PROVIDER
Constant attribute that represents the BC Provider.
-
BC_PROVIDER_TOKEN_NAME
public static final java.lang.String BC_PROVIDER_TOKEN_NAME
Constant attribute that represents the string to identify the name of the Bouncy Castle Provider.
-
-
Method Detail
-
initializeProviders
public static void initializeProviders()
Method that initializes the providers.
-
getSecureRandomForSeedAlgorithmProvider
public static java.security.SecureRandom getSecureRandomForSeedAlgorithmProvider(java.lang.String algNameSecRandom, java.security.Provider prov)Gets the secure random used for the input seed algorithm in the input provider. If the input provider isnull, then left the decision to the JDK.- Parameters:
algNameSecRandom- Algorithm name of the seed generator to set.prov- Provider to use for the seed algorithm.- Returns:
- Returns the
SecureRandomimplementation for the input seed algorithm by the input provider. If not is found, then returnnull.
-
getSecureRandomForSeedAlgorithmProviderName
public static java.security.SecureRandom getSecureRandomForSeedAlgorithmProviderName(java.lang.String algNameSecRandom, java.lang.String provName)Gets the secure random used for the input seed algorithm in the input provider. If the input provider isnull, then left the decision to the JDK.- Parameters:
algNameSecRandom- Algorithm name of the sedd generator to set.provName- Provider name to use for the seed generator.- Returns:
- Returns the
SecureRandomimplementation for the input seed algorithm by the input provider. If not is found, then returnnull.
-
resetAllSecureRandomCache
public static void resetAllSecureRandomCache()
Reset the seed algorithm generator cache.
-
-