Package java.security.spec
Class PSSParameterSpec
java.lang.Object
java.security.spec.PSSParameterSpec
- All Implemented Interfaces:
AlgorithmParameterSpec
public class PSSParameterSpec extends Object implements AlgorithmParameterSpec
The parameter specification for the RSA-PSS Signature scheme.
Defined in the PKCS #1 v2.1 standard.
-
Field Summary
Fields Modifier and Type Field Description static PSSParameterSpecDEFAULTThe default parameter specification. -
Constructor Summary
Constructors Constructor Description PSSParameterSpec(int saltLen)Creates a newPSSParameterSpecwith the specified salt length and the default values.PSSParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField)Creates a newPSSParameterSpecwith the specified message digest name, mask generation function name, mask generation function parameters, salt length, and trailer field value. -
Method Summary
Modifier and Type Method Description StringgetDigestAlgorithm()Returns the name of the message digest algorithm.StringgetMGFAlgorithm()Returns the name of the mask generation function algorithm.AlgorithmParameterSpecgetMGFParameters()Returns the parameter for the mask generation function algorithm.intgetSaltLength()Returns the length of the salt (in bits).intgetTrailerField()Returns the trailer field value.
-
Field Details
-
DEFAULT
The default parameter specification. It specifies the following parameters:- message digest:
"SHA-1" - mask generation function (mgf):
"MGF1" - parameters for the mgf:
MGF1ParameterSpec.SHA1 - salt length:
20 - trailer field:
-1
- message digest:
-
-
Constructor Details
-
PSSParameterSpec
public PSSParameterSpec(int saltLen)Creates a newPSSParameterSpecwith the specified salt length and the default values.- Parameters:
saltLen- the salt length (in bits).- Throws:
IllegalArgumentException- ifsaltLenis negative.
-
PSSParameterSpec
public PSSParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField)Creates a newPSSParameterSpecwith the specified message digest name, mask generation function name, mask generation function parameters, salt length, and trailer field value.- Parameters:
mdName- the name of the message digest algorithm.mgfName- the name of the mask generation function algorithm.mgfSpec- the parameter for the mask generation function algorithm.saltLen- the salt length (in bits).trailerField- the trailer field value.- Throws:
IllegalArgumentException- ifsaltLenortrailerFieldis negative.
-
-
Method Details
-
getSaltLength
public int getSaltLength()Returns the length of the salt (in bits).- Returns:
- the length of the salt (in bits).
-
getDigestAlgorithm
Returns the name of the message digest algorithm.- Returns:
- the name of the message digest algorithm.
-
getMGFAlgorithm
Returns the name of the mask generation function algorithm.- Returns:
- the name of the mask generation function algorithm.
-
getMGFParameters
Returns the parameter for the mask generation function algorithm.- Returns:
- the parameter for the mask generation function algorithm, or
nullif none specified.
-
getTrailerField
public int getTrailerField()Returns the trailer field value.- Returns:
- the trailer field value.
-