public abstract class AbstractHashBean extends Object
Constructor and Description |
---|
AbstractHashBean()
Creates a new instance.
|
AbstractHashBean(Spec<org.bouncycastle.crypto.Digest> digestSpec,
int iterations)
Creates a new instance by specifying all properties.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
compareInternal(byte[] hash,
Object... data)
Compares the hash of the given data against a known hash output.
|
Spec<org.bouncycastle.crypto.Digest> |
getDigestSpec() |
int |
getIterations() |
protected byte[] |
hashInternal(Object... data)
Hashes the given data.
|
void |
setDigestSpec(Spec<org.bouncycastle.crypto.Digest> digestSpec)
Sets the digest specification that determines the instance of
Digest used to compute the hash. |
void |
setIterations(int iterations)
Sets the number of iterations the digest function is applied to the input
data.
|
public AbstractHashBean()
public AbstractHashBean(Spec<org.bouncycastle.crypto.Digest> digestSpec, int iterations)
digestSpec
- Digest specification.iterations
- Number of hash rounds.public Spec<org.bouncycastle.crypto.Digest> getDigestSpec()
Digest
used to compute the hash.public void setDigestSpec(Spec<org.bouncycastle.crypto.Digest> digestSpec)
Digest
used to compute the hash.digestSpec
- Digest algorithm specification.public int getIterations()
public void setIterations(int iterations)
iterations
- Number of hash rounds. Default value is 1.protected byte[] hashInternal(Object... data)
data
- Data to hash.protected boolean compareInternal(byte[] hash, Object... data)
hash
- Known hash value. If the length of the array is greater than
the length of the digest output, anything beyond the digest
length is considered salt data that is hashed
after the input data.data
- Data to hash.Copyright © 2016 JBoss by Red Hat. All rights reserved.