public enum HashAlgorithm extends Enum<HashAlgorithm>
Modifier and Type | Class and Description |
---|---|
static class |
HashAlgorithm.Status
Support status of the hash algorithm.
|
Enum Constant and Description |
---|
RIPEMD_160 |
SHA1 |
SHA2_256 |
SHA2_384 |
SHA2_512 |
SHA3_224 |
SHA3_256 |
SHA3_384 |
SHA3_512 |
SM3 |
Modifier and Type | Method and Description |
---|---|
void |
checkExpiration()
Checks that the hash algorithm is NOT marked obsolete or deprecated.
|
static HashAlgorithm |
getById(int id)
Gets the hash algorithm by ID.
|
static HashAlgorithm |
getByName(String name)
Gets the hash algorithm by name.
|
Date |
getDeprecatedSince() |
int |
getId()
Gets ID for the DataHash.
|
static List<HashAlgorithm> |
getImplementedHashAlgorithms()
Returns the list of implemented algorithms.
|
int |
getLength()
Gets the length of the hash value for DataHash in octets.
|
String |
getName()
Gets the name of the algorithm for DataHash.
|
Date |
getObsoleteSince() |
HashAlgorithm.Status |
getStatus()
Gets the status of the algorithm for DataHash.
|
boolean |
isDeprecated(Date givenDate) |
static boolean |
isHashAlgorithmId(int id)
Checks if the input ID is the hash algorithm ID.
|
boolean |
isImplemented() |
boolean |
isObsolete(Date givenDate) |
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 SHA1
public static final HashAlgorithm SHA2_256
public static final HashAlgorithm RIPEMD_160
public static final HashAlgorithm SHA2_384
public static final HashAlgorithm SHA2_512
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 SM3
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 static HashAlgorithm getById(int id)
id
- one-byte hash function identifier.HashAlgorithm
, if a match is found, otherwise null.IllegalArgumentException
- if algorithm is unknown.public static boolean isHashAlgorithmId(int id)
id
- one-byte hash function identifier.public static HashAlgorithm getByName(String name)
name
- name of the algorithm to look for.HashAlgorithm
, if a match is found, otherwise null.public static List<HashAlgorithm> getImplementedHashAlgorithms()
HashAlgorithm.Status.NORMAL
or HashAlgorithm.Status.NOT_TRUSTED
public int getId()
public int getLength()
public String getName()
public HashAlgorithm.Status getStatus()
public Date getDeprecatedSince()
public Date getObsoleteSince()
public boolean isImplemented()
public boolean isDeprecated(Date givenDate)
givenDate
- date to check against the hash algorithm deprecation date.public boolean isObsolete(Date givenDate)
givenDate
- date to check against the date since when the algorithm is considered obsolete.public void checkExpiration()
Copyright © 2024 Guardtime. All rights reserved.