public class HashUtils extends Object
Constructor and Description |
---|
HashUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getFingerPrint(String base64EncodedKey)
Returns the fingerprint of the given Base64 encoded key.
|
static String |
hash(String algorithm,
byte[] input)
Hashes the input byte array using the given algorithm and returns the string hex representation.
|
static String |
SHA1(byte[] input)
Hashes the byte array with the SHA-1 algorithm and returns the string hex representation.
|
static String |
SHA1(String input)
Hashes the input string with the SHA-1 algorithm and returns the string hex representation.
|
static String |
SHA512(byte[] input)
Hashes the input byte array with the SHA-512 algorithm and returns the string hex representation.
|
static String |
SHA512(String input)
Hashes the input string with the SHA-512 algorithm and returns the string hex representation.
|
public static String SHA1(String input)
input
- the string that will be hashedpublic static String SHA1(byte[] input)
input
- the byte array that will be hashedpublic static String SHA512(String input)
input
- the string that will be hashedpublic static String SHA512(byte[] input)
input
- the byte array that will be hashedpublic static String hash(String algorithm, byte[] input) throws NoSuchAlgorithmException
algorithm
- the hash algorithm (e.g. "SHA-512")input
- the byte array that will be hashedNoSuchAlgorithmException
- if the algorithm does not exist in this JVM.public static String getFingerPrint(String base64EncodedKey)
base64EncodedKey
- a base64 encoded key.Copyright © 2015 Universitätsmedizin Mainz, Abteilung IMBEI. All rights reserved.