Class UtilsProviders


  • public final class UtilsProviders
    extends java.lang.Object

    Utilities 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.Provider BC_PROVIDER
      Constant attribute that represents the BC Provider.
      static java.lang.String BC_PROVIDER_TOKEN_NAME
      Constant attribute that represents the string to identify the name of the Bouncy Castle Provider.
      static java.lang.String SEED_ALGORITHM_SHA1PRNG
      Constant 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.SecureRandom getSecureRandomForSeedAlgorithmProvider​(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.SecureRandom getSecureRandomForSeedAlgorithmProviderName​(java.lang.String algNameSecRandom, java.lang.String provName)
      Gets the secure random used for the input seed algorithm in the input provider.
      static void initializeProviders()
      Method that initializes the providers.
      static void resetAllSecureRandomCache()
      Reset the seed algorithm generator cache.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 is null, 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 SecureRandom implementation for the input seed algorithm by the input provider. If not is found, then return null.
      • 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 is null, 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 SecureRandom implementation for the input seed algorithm by the input provider. If not is found, then return null.
      • resetAllSecureRandomCache

        public static void resetAllSecureRandomCache()
        Reset the seed algorithm generator cache.