Class CryptoInfoService

java.lang.Object
com.eurodyn.qlack.fuse.crypto.service.CryptoInfoService

@Service @Validated public class CryptoInfoService extends Object
A provider of information regarding the security algorithms and services available in the runtime.
  • Constructor Details

    • CryptoInfoService

      public CryptoInfoService()
  • Method Details

    • getSecurityProviders

      public List<SecurityProviderDTO> getSecurityProviders()
      Returns the security providers available in the runtime.
      Returns:
      a list containing the found providers
    • getSecurityServices

      public List<SecurityServiceDTO> getSecurityServices(String providerName)
      Returns the security services provided by a specific provider available in the runtime.
      Parameters:
      providerName - the provider to inquiry for available services
      Returns:
      a list containing the found services
    • getSecurityServicesForAlgorithmType

      public List<SecurityServiceDTO> getSecurityServicesForAlgorithmType(String algorithmType)
      Returns the security services providing a specific security algorithm.
      Parameters:
      algorithmType - the algorithm type to find services providing it
      Returns:
      a list containing the found services
    • getAlgorithmTypes

      public List<String> getAlgorithmTypes()
      Returns all available security algorithms available in the runtime.
      Returns:
      a list containing the found algorithms
    • prettyPrint

      public String prettyPrint(List<SecurityServiceDTO> services)
      Pretty prints a list of services.
      Parameters:
      services - the list of services to pretty print
      Returns:
      the generated string
    • isUnlimitedStrengthActive

      public boolean isUnlimitedStrengthActive() throws NoSuchAlgorithmException
      Checks if unlimited strength cryptography is available. The check is taking place by comparing the maximum size available of an AES key. If this method returns false, you can enable unlimited strength cryptography by downloading https://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html (or in JDK > 8 by setting Security.setProperty("crypto.policy", "unlimited")).
      Returns:
      true if capacity is enough, false if it is not
      Throws:
      NoSuchAlgorithmException - thrown when no algorithm is found for encryption