public final class HashManager extends Manager
Modifier and Type | Class and Description |
---|---|
static class |
HashManager.ALGORITHM |
static class |
HashManager.NAMESPACE |
Modifier and Type | Field and Description |
---|---|
static String |
PREFIX_NS_ALGO |
static String |
PROVIDER |
static List<HashManager.ALGORITHM> |
RECOMMENDED |
Modifier and Type | Method and Description |
---|---|
void |
addAlgorithmsToFeatures(List<HashManager.ALGORITHM> algorithms)
Announce support for the given list of algorithms.
|
static String |
asFeature(HashManager.ALGORITHM algorithm)
Return the feature name of the given algorithm.
|
static HashElement |
assembleHashElement(HashManager.ALGORITHM algorithm,
byte[] hash) |
static byte[] |
blake2b160(byte[] data) |
static byte[] |
blake2b160(String data) |
static String |
blake2b160HexString(byte[] data) |
static String |
blake2b160HexString(String data) |
static byte[] |
blake2b256(byte[] data) |
static byte[] |
blake2b256(String data) |
static String |
blake2b256HexString(byte[] data) |
static String |
blake2b256HexString(String data) |
static byte[] |
blake2b384(byte[] data) |
static byte[] |
blake2b384(String data) |
static String |
blake2b384HexString(byte[] data) |
static String |
blake2b384HexString(String data) |
static byte[] |
blake2b512(byte[] data) |
static byte[] |
blake2b512(String data) |
static String |
blake2b512HexString(byte[] data) |
static String |
blake2b512HexString(String data) |
static HashElement |
calculateHashElement(HashManager.ALGORITHM algorithm,
byte[] data) |
static HashManager |
getInstanceFor(XMPPConnection connection)
Get an instance of the HashManager for the given connection.
|
static MessageDigest |
getMessageDigest(HashManager.ALGORITHM algorithm) |
static byte[] |
hash(HashManager.ALGORITHM algorithm,
byte[] data)
Calculate the hash sum of data using algorithm.
|
static byte[] |
hash(HashManager.ALGORITHM algorithm,
String data) |
static byte[] |
md5(byte[] data) |
static byte[] |
md5(String data) |
static String |
md5HexString(byte[] data) |
static String |
md5HexString(String data) |
static byte[] |
sha_1(byte[] data) |
static byte[] |
sha_1(String data) |
static String |
sha_1HexString(byte[] data) |
static String |
sha_1HexString(String data) |
static byte[] |
sha_224(byte[] data) |
static byte[] |
sha_224(String data) |
static String |
sha_224HexString(byte[] data) |
static String |
sha_224HexString(String data) |
static byte[] |
sha_256(byte[] data) |
static byte[] |
sha_256(String data) |
static String |
sha_256HexString(byte[] data) |
static String |
sha_256HexString(String data) |
static byte[] |
sha_384(byte[] data) |
static byte[] |
sha_384(String data) |
static String |
sha_384HexString(byte[] data) |
static String |
sha_384HexString(String data) |
static byte[] |
sha_512(byte[] data) |
static byte[] |
sha_512(String data) |
static String |
sha_512HexString(byte[] data) |
static String |
sha_512HexString(String data) |
static byte[] |
sha3_224(byte[] data) |
static byte[] |
sha3_224(String data) |
static String |
sha3_224HexString(byte[] data) |
static String |
sha3_224HexString(String data) |
static byte[] |
sha3_256(byte[] data) |
static byte[] |
sha3_256(String data) |
static String |
sha3_256HexString(byte[] data) |
static String |
sha3_256HexString(String data) |
static byte[] |
sha3_384(byte[] data) |
static byte[] |
sha3_384(String data) |
static String |
sha3_384HexString(byte[] data) |
static String |
sha3_384HexString(String data) |
static byte[] |
sha3_512(byte[] data) |
static byte[] |
sha3_512(String data) |
static String |
sha3_512HexString(byte[] data) |
static String |
sha3_512HexString(String data) |
connection, getAuthenticatedConnectionOrThrow, schedule
public static final String PROVIDER
public static final String PREFIX_NS_ALGO
public static final List<HashManager.ALGORITHM> RECOMMENDED
public static HashElement calculateHashElement(HashManager.ALGORITHM algorithm, byte[] data)
public static HashElement assembleHashElement(HashManager.ALGORITHM algorithm, byte[] hash)
public void addAlgorithmsToFeatures(List<HashManager.ALGORITHM> algorithms)
algorithms
- public static HashManager getInstanceFor(XMPPConnection connection)
connection
- public static String asFeature(HashManager.ALGORITHM algorithm)
algorithm
- eg. 'SHA_1'public static byte[] hash(HashManager.ALGORITHM algorithm, byte[] data)
algorithm
- the algorithm to use.data
- the data to calculate the hash for.public static byte[] hash(HashManager.ALGORITHM algorithm, String data)
public static MessageDigest getMessageDigest(HashManager.ALGORITHM algorithm)
public static byte[] md5(byte[] data)
public static String md5HexString(byte[] data)
public static String md5HexString(String data)
public static byte[] sha_1(byte[] data)
public static String sha_1HexString(byte[] data)
public static String sha_1HexString(String data)
public static byte[] sha_224(byte[] data)
public static String sha_224HexString(byte[] data)
public static String sha_224HexString(String data)
public static byte[] sha_256(byte[] data)
public static String sha_256HexString(byte[] data)
public static String sha_256HexString(String data)
public static byte[] sha_384(byte[] data)
public static String sha_384HexString(byte[] data)
public static String sha_384HexString(String data)
public static byte[] sha_512(byte[] data)
public static String sha_512HexString(byte[] data)
public static String sha_512HexString(String data)
public static byte[] sha3_224(byte[] data)
public static String sha3_224HexString(byte[] data)
public static String sha3_224HexString(String data)
public static byte[] sha3_256(byte[] data)
public static String sha3_256HexString(byte[] data)
public static String sha3_256HexString(String data)
public static byte[] sha3_384(byte[] data)
public static String sha3_384HexString(byte[] data)
public static String sha3_384HexString(String data)
public static byte[] sha3_512(byte[] data)
public static String sha3_512HexString(byte[] data)
public static String sha3_512HexString(String data)
public static byte[] blake2b160(byte[] data)
public static byte[] blake2b160(String data)
public static String blake2b160HexString(byte[] data)
public static String blake2b160HexString(String data)
public static byte[] blake2b256(byte[] data)
public static byte[] blake2b256(String data)
public static String blake2b256HexString(byte[] data)
public static String blake2b256HexString(String data)
public static byte[] blake2b384(byte[] data)
public static byte[] blake2b384(String data)
public static String blake2b384HexString(byte[] data)
public static String blake2b384HexString(String data)
public static byte[] blake2b512(byte[] data)
public static byte[] blake2b512(String data)
public static String blake2b512HexString(byte[] data)
public static String blake2b512HexString(String data)