public class MGF1ParameterSpec extends PKCS1AlgorithmParameterSpec
MGF1
mask generation function.
According to PKCS#1v2.1 the only parameter used by MGF1 is the algorithm id of the hash algorithm (default SHA-1) to be used:
mgf1SHA1 MaskGenAlgorithm ::= {
algorithm id-mgf1,
parameters HashAlgorithm : sha1
}
| Constructor and Description |
|---|
MGF1ParameterSpec()
Creates a new MGF1ParameterSpec for the default hash algorithm (SHA-1)
to be used with MGF1.
|
MGF1ParameterSpec(AlgorithmID hashAlgorithm)
Creates a new MGF1ParameterSpec for the hash algorithm to be used with MGF1.
|
| Modifier and Type | Method and Description |
|---|---|
AlgorithmID |
getHashAlgorithm()
Returns the hash algorithm to be used
|
java.security.MessageDigest |
getHashEngine()
Gets the JCA MessageDigest engine to be used by MGF1.
|
void |
setHashEngine(java.security.MessageDigest hashEngine)
Sets the JCA MessageDigest engine to be used by MGF1.
|
java.lang.String |
toString()
Returns a String representation of this object.
|
getSecureRandom, setSecureRandompublic MGF1ParameterSpec()
public MGF1ParameterSpec(AlgorithmID hashAlgorithm)
hashAlgorithm - the hash algorithm IDpublic AlgorithmID getHashAlgorithm()
public void setHashEngine(java.security.MessageDigest hashEngine)
This method may be used to set a JCA MessageDigest engine to be used by MGF1 for
doing the any required hashing operations. If not set by this method, getHashEngine will try to create a MessageDigest engine from
the algorithm id.
hashEngine - the JCA MessageDigest engine to be usedpublic java.security.MessageDigest getHashEngine()
throws java.security.NoSuchAlgorithmException
If method setHashEngine has been used to set a
MessageDigest engine, this engine is returned; otherwise it is tried
to create a MessageDigest engine from the algorithm id.
java.security.NoSuchAlgorithmExceptionpublic java.lang.String toString()
toString in class java.lang.Object