Package org.hyperledger.fabric.client
Enum Hash
- All Implemented Interfaces:
Serializable
,Comparable<Hash>
,Function<byte[],
byte[]>
Hash function implementations used to generate a digest of a supplied message.
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
apply
(byte[] message) Hash the supplied message to create a digest for signing.static byte[]
sha256
(byte[] message) Deprecated.static Hash
Returns the enum constant of this type with the specified name.static Hash[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NONE
Returns the input message unchanged. This can be used if the signing implementation requires the full message bytes, not just a pre-generated digest, such as Ed25519. -
SHA256
SHA-256 hash. -
SHA384
SHA-384 hash. -
SHA3_256
SHA3-256 hash. -
SHA3_384
SHA3-384 hash.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
sha256
Deprecated.Replaced bySHA256
SHA-256 hash the supplied message to create a digest for signing.- Parameters:
message
- Message to be hashed.- Returns:
- Message digest.
-
apply
public byte[] apply(byte[] message) Hash the supplied message to create a digest for signing.
-
SHA256