public static interface Credentials.Encoder
| Modifier and Type | Field and Description |
|---|---|
static String |
HASH_MD2
MD2 hash algorithm name
|
static String |
HASH_MD5
MD5 hash algorithm name
|
static String |
HASH_SHA_1
SHA-1 hash algorithm name
|
static String |
HASH_SHA_256
SHA-256 hash algorithm name
|
static String |
HASH_SHA_384
SHA-384 hash algorithm name
|
static String |
HASH_SHA_512
SHA-512 hash algorithm name
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
build()
Hash given secret
|
String |
buildAndEncodeBase64()
Hash given secret and encode using Base64
|
Credentials.Encoder |
charset(String charset)
Secret encoding charset name.
|
Credentials.Encoder |
hashAlgorithm(String algorithm)
Hash algorithm to use.
|
Credentials.Encoder |
hashIterations(int iterations)
Set hash iterations to perform.
|
Credentials.Encoder |
hashMD5()
Apply MD5 hash algorithm
|
Credentials.Encoder |
hashSHA1()
Apply SHA-1 hash algorithm
|
Credentials.Encoder |
hashSHA256()
Apply SHA-256 hash algorithm
|
Credentials.Encoder |
hashSHA384()
Apply SHA-384 hash algorithm
|
Credentials.Encoder |
hashSHA512()
Apply SHA-512 hash algorithm
|
Credentials.Encoder |
salt(byte[] salt)
Optional salt to use for hashing
|
Credentials.Encoder |
salt(String salt)
Optional salt to use for hashing
|
Credentials.Encoder |
secret(String secret)
Secret text to encode
|
static final String HASH_MD2
static final String HASH_MD5
static final String HASH_SHA_1
static final String HASH_SHA_256
static final String HASH_SHA_384
static final String HASH_SHA_512
Credentials.Encoder secret(String secret)
secret - Secret text (for example a password)Credentials.Encoder salt(byte[] salt)
salt - Salt dataHash.generateSalt()Credentials.Encoder salt(String salt)
salt - Salt stringHash.generateSalt()Credentials.Encoder hashAlgorithm(String algorithm)
algorithm - Hash algorithm nameCredentials.Encoder hashMD5()
Credentials.Encoder hashSHA1()
Credentials.Encoder hashSHA256()
Credentials.Encoder hashSHA384()
Credentials.Encoder hashSHA512()
Credentials.Encoder hashIterations(int iterations)
iterations - Hash iterationsCredentials.Encoder charset(String charset)
charset - Charset namebyte[] build()
String buildAndEncodeBase64()
Copyright © 2019 The Holon Platform. All rights reserved.