code: private String getDigestHex(String algorithm, String key) {
          if (algorithm.equals("md5")) {
              return DigestUtils.md5Hex(key);
          } else if (algorithm.equals("sha")) {
              return DigestUtils.shaHex(key);
          }
          
          throw new CitrusRuntimeException("Unsupported digest algorithm: " + algorithm);
      }
docs: Generates digest hexadecimal string representation of a key with given
  algorithm.
  
  @param algorithm
  @param key
  @return