/** * Returns an array of {@link AllowableValue} elements for each {@link HashAlgorithm}. The * complete {@code description} is built from the digest length, safety warnings, etc. See * {@link HashAlgorithm#buildAllowableValueDescription()}. * * @return an ordered {@code AllowableValue[]} containing the values */ public static AllowableValue[] buildHashAlgorithmAllowableValues() { final HashAlgorithm[] hashAlgorithms = HashAlgorithm.values(); List<AllowableValue> allowableValues = new ArrayList<>(hashAlgorithms.length); for (HashAlgorithm algorithm : hashAlgorithms) { allowableValues.add(new AllowableValue(algorithm.getName(), algorithm.getName(), algorithm.buildAllowableValueDescription())); } return allowableValues.toArray(new AllowableValue[0]); }
/** * Returns an array of {@link AllowableValue} elements for each {@link HashAlgorithm}. The * complete {@code description} is built from the digest length, safety warnings, etc. See * {@link HashAlgorithm#buildAllowableValueDescription()}. * * @return an ordered {@code AllowableValue[]} containing the values */ public static AllowableValue[] buildHashAlgorithmAllowableValues() { final HashAlgorithm[] hashAlgorithms = HashAlgorithm.values(); List<AllowableValue> allowableValues = new ArrayList<>(hashAlgorithms.length); for (HashAlgorithm algorithm : hashAlgorithms) { allowableValues.add(new AllowableValue(algorithm.getName(), algorithm.getName(), algorithm.buildAllowableValueDescription())); } return allowableValues.toArray(new AllowableValue[0]); }