public enum HashAlgorithm extends Enum<HashAlgorithm>
Enum Constant and Description |
---|
BLAKE2_160 |
BLAKE2_256 |
BLAKE2_384 |
BLAKE2_512 |
MD2 |
MD5 |
SHA1 |
SHA224 |
SHA256 |
SHA3_224 |
SHA3_256 |
SHA3_384 |
SHA3_512 |
SHA384 |
SHA512 |
SHA512_224 |
SHA512_256 |
Modifier and Type | Field and Description |
---|---|
private static List<String> |
BROKEN_ALGORITHMS |
private String |
description |
private int |
digestBytesLength |
private String |
name |
Modifier and Type | Method and Description |
---|---|
String |
buildAllowableValueDescription()
Returns a more complete description of the algorithm for
AllowableValue construction. |
static HashAlgorithm |
fromName(String algorithmName) |
String |
getDescription() |
int |
getDigestBytesLength() |
String |
getName() |
boolean |
isBlake2()
Returns
true if this hash algorithm is Blake2, as it requires different initialization through BouncyCastle. |
boolean |
isStrongAlgorithm()
Returns
true if this algorithm is considered cryptographically secure. |
String |
toString() |
static HashAlgorithm |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HashAlgorithm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HashAlgorithm MD2
public static final HashAlgorithm MD5
public static final HashAlgorithm SHA1
public static final HashAlgorithm SHA224
public static final HashAlgorithm SHA256
public static final HashAlgorithm SHA384
public static final HashAlgorithm SHA512
public static final HashAlgorithm SHA512_224
public static final HashAlgorithm SHA512_256
public static final HashAlgorithm SHA3_224
public static final HashAlgorithm SHA3_256
public static final HashAlgorithm SHA3_384
public static final HashAlgorithm SHA3_512
public static final HashAlgorithm BLAKE2_160
public static final HashAlgorithm BLAKE2_256
public static final HashAlgorithm BLAKE2_384
public static final HashAlgorithm BLAKE2_512
private final String name
private final int digestBytesLength
private final String description
public static HashAlgorithm[] values()
for (HashAlgorithm c : HashAlgorithm.values()) System.out.println(c);
public static HashAlgorithm valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String getName()
public int getDigestBytesLength()
public String getDescription()
public boolean isStrongAlgorithm()
true
if this algorithm is considered cryptographically secure. These determinations were made as of 2018-08-30.
Current strong algorithms:
* SHA-224 (SHA2)
* SHA-256 (SHA2)
* SHA-384 (SHA2)
* SHA-512 (SHA2)
* SHA-512/224 (SHA2)
* SHA-512/256 (SHA2)
* SHA3-224
* SHA3-256
* SHA3-384
* SHA3-512
* Blake2b-160
* Blake2b-256
* Blake2b-384
* Blake2b-512
Current broken algorithms:
* MD2
* MD5
* SHA-1public boolean isBlake2()
true
if this hash algorithm is Blake2, as it requires different initialization through BouncyCastle.public String toString()
toString
in class Enum<HashAlgorithm>
public String buildAllowableValueDescription()
AllowableValue
construction.
Ex:
description
-- Cryptographically broken due to collisions
buildAllowableValueDescription
-- SHA-1 (20 byte output) [WARNING -- Cryptographically broken] Cryptographically broken due to collisionspublic static HashAlgorithm fromName(String algorithmName)
Copyright © 2021 Apache NiFi Project. All rights reserved.