private static void listCiphers() {
    System.out.println("Available ciphers:");

    for (Provider provider : Security.getProviders()) {
      String providerName = provider.getName();

      for (Provider.Service service : provider.getServices()) {
        String algorithmName = service.getAlgorithm();

        if ("Cipher".equalsIgnoreCase(service.getType())) {
          try {
            long keylength = Cipher.getMaxAllowedKeyLength(algorithmName);

            System.out.print('\t');
            System.out.print(providerName.toLowerCase());
            System.out.print('.');
            System.out.print(algorithmName.toLowerCase());
            System.out.print(": ");
            System.out.println(keylength);
          } catch (NoSuchAlgorithmException e) {
            // This is unlikely since we are getting the algorithm names from the service providers.
            // In any case, if a bad algorithm is listed it can be skipped since this is only for
            // informational purposes.
          }
        }
      }
    }
  }
Display the list of available ciphers and their maximum suported key lengths.
ambari-agent/src/main/java/org/apache/ambari/tools/jce/JcePolicyInfo.java