public static class DefaultCredentials.CredentialsEncoder extends Object implements Credentials.Encoder
Encoder
implementation.HASH_MD2, HASH_MD5, HASH_SHA_1, HASH_SHA_256, HASH_SHA_384, HASH_SHA_512
Constructor and Description |
---|
CredentialsEncoder() |
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
|
public Credentials.Encoder secret(String secret)
Credentials.Encoder
secret
in interface Credentials.Encoder
secret
- Secret text (for example a password)public Credentials.Encoder salt(byte[] salt)
Credentials.Encoder
salt
in interface Credentials.Encoder
salt
- Salt dataHash.generateSalt()
public Credentials.Encoder salt(String salt)
Credentials.Encoder
salt
in interface Credentials.Encoder
salt
- Salt stringHash.generateSalt()
public Credentials.Encoder hashAlgorithm(String algorithm)
Credentials.Encoder
hashAlgorithm
in interface Credentials.Encoder
algorithm
- Hash algorithm namepublic Credentials.Encoder hashMD5()
Credentials.Encoder
hashMD5
in interface Credentials.Encoder
public Credentials.Encoder hashSHA1()
Credentials.Encoder
hashSHA1
in interface Credentials.Encoder
public Credentials.Encoder hashSHA256()
Credentials.Encoder
hashSHA256
in interface Credentials.Encoder
public Credentials.Encoder hashSHA384()
Credentials.Encoder
hashSHA384
in interface Credentials.Encoder
public Credentials.Encoder hashSHA512()
Credentials.Encoder
hashSHA512
in interface Credentials.Encoder
public Credentials.Encoder hashIterations(int iterations)
Credentials.Encoder
hashIterations
in interface Credentials.Encoder
iterations
- Hash iterationspublic Credentials.Encoder charset(String charset)
Credentials.Encoder
charset
in interface Credentials.Encoder
charset
- Charset namepublic byte[] build()
Credentials.Encoder
build
in interface Credentials.Encoder
public String buildAndEncodeBase64()
Credentials.Encoder
buildAndEncodeBase64
in interface Credentials.Encoder
Copyright © 2019 The Holon Platform. All rights reserved.