Top Description Fields Constructors Methods
java.security.spec

public Class PSSParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.util.Objects

This class specifies a parameter spec for the RSASSA-PSS signature scheme, as defined in the PKCS#1 v2.2 standard.

Its ASN.1 definition in the PKCS #1 standard is described below:

RSASSA-PSS-params ::= SEQUENCE {
  hashAlgorithm      [0] HashAlgorithm      DEFAULT sha1,
  maskGenAlgorithm   [1] MaskGenAlgorithm   DEFAULT mgf1SHA1,
  saltLength         [2] INTEGER            DEFAULT 20,
  trailerField       [3] TrailerField       DEFAULT trailerFieldBC(1)
}
where
HashAlgorithm ::= AlgorithmIdentifier {
  {OAEP-PSSDigestAlgorithms}
}
MaskGenAlgorithm ::= AlgorithmIdentifier { {PKCS1MGFAlgorithms} }
TrailerField ::= INTEGER { trailerFieldBC(1) }

OAEP-PSSDigestAlgorithms    ALGORITHM-IDENTIFIER ::= {
  { OID id-sha1       PARAMETERS NULL }|
  { OID id-sha224     PARAMETERS NULL }|
  { OID id-sha256     PARAMETERS NULL }|
  { OID id-sha384     PARAMETERS NULL }|
  { OID id-sha512     PARAMETERS NULL }|
  { OID id-sha512-224 PARAMETERS NULL }|
  { OID id-sha512-256 PARAMETERS NULL },
  ...  -- Allows for future expansion --
}
PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
  { OID id-mgf1 PARAMETERS HashAlgorithm },
  ...  -- Allows for future expansion --
}
Author
Valerie Peng
Since
1.4
See Also
MGF1ParameterSpec, AlgorithmParameterSpec, java.security.Signature

Field Summary

Modifier and TypeField and Description
public static final PSSParameterSpec
DEFAULT

Deprecated since 19. This field uses the default values defined in the PKCS #1 standard.
The PSS parameter set with all default values.
private final String
private final String
private final AlgorithmParameterSpec
private final int
public static final int
TRAILER_FIELD_BC

The TrailerFieldBC constant as defined in the PKCS #1 standard.

private final int

Constructor Summary

AccessConstructor and Description
public
PSSParameterSpec(String
the algorithm name of the hash function
mdName
,
String
the algorithm name of the mask generation function
mgfName
,
AlgorithmParameterSpec
the parameters for the mask generation function. If null is specified, null will be returned by getMGFParameters().
mgfSpec
,
int
the length of salt in bytes
saltLen
,
int
the value of the trailer field
trailerField
)

Creates a new PSSParameterSpec as defined in the PKCS #1 standard using the specified message digest, mask generation function, parameters for mask generation function, salt length, and trailer field values.

public
PSSParameterSpec(int
the length of salt in bytes
saltLen
)
Deprecated since 19. This constructor uses the default values defined in the PKCS #1 standard except for the salt length.

Creates a new PSSParameterSpec using the specified salt length and other default values as defined in the PKCS #1 standard.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the message digest algorithm name
getDigestAlgorithm
()

Returns the message digest algorithm name.

public String

Returns:

the mask generation function algorithm name
getMGFAlgorithm
()

Returns the mask generation function algorithm name.

public AlgorithmParameterSpec

Returns:

the parameters for the mask generation function
getMGFParameters
()

Returns the parameters for the mask generation function.

public int

Returns:

the salt length
getSaltLength
()

Returns the salt length in bytes.

public int

Returns:

the value for the trailer field
getTrailerField
()

Returns the value for the trailer field.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULTback to summary
public static final PSSParameterSpec DEFAULT

Deprecated

since 19.

This field uses the default values defined in the PKCS #1 standard. Some of these defaults are no longer recommended due to advances in cryptanalysis -- see the PKCS#1 v2.2 standard for more details. Thus, it is recommended to create a new PSSParameterSpec with the desired parameter values using the PSSParameterSpec(String, String, AlgorithmParameterSpec, int, int) constructor.

The PSS parameter set with all default values.

Annotations
@Deprecated
since:19
Since
1.5
mdNameback to summary
private final String mdName
mgfNameback to summary
private final String mgfName
mgfSpecback to summary
private final AlgorithmParameterSpec mgfSpec
saltLenback to summary
private final int saltLen
TRAILER_FIELD_BCback to summary
public static final int TRAILER_FIELD_BC

The TrailerFieldBC constant as defined in the PKCS #1 standard.

Since
11
trailerFieldback to summary
private final int trailerField

Constructor Detail

PSSParameterSpecback to summary
public PSSParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField)

Creates a new PSSParameterSpec as defined in the PKCS #1 standard using the specified message digest, mask generation function, parameters for mask generation function, salt length, and trailer field values.

Parameters
mdName:String

the algorithm name of the hash function

mgfName:String

the algorithm name of the mask generation function

mgfSpec:AlgorithmParameterSpec

the parameters for the mask generation function. If null is specified, null will be returned by getMGFParameters().

saltLen:int

the length of salt in bytes

trailerField:int

the value of the trailer field

Exceptions
NullPointerException:
if mdName, or mgfName is null
IllegalArgumentException:
if saltLen or trailerField is less than 0
Since
1.5
PSSParameterSpecback to summary
public PSSParameterSpec(int saltLen)

Deprecated

since 19.

This constructor uses the default values defined in the PKCS #1 standard except for the salt length. Some of these defaults are no longer recommended due to advances in cryptanalysis -- see the PKCS#1 v2.2 standard for more details. Thus, it is recommended to explicitly specify all desired parameter values with the PSSParameterSpec(String, String, AlgorithmParameterSpec, int, int) constructor.

Creates a new PSSParameterSpec using the specified salt length and other default values as defined in the PKCS #1 standard.

Parameters
saltLen:int

the length of salt in bytes

Annotations
@Deprecated
since:19
Exceptions
IllegalArgumentException:
if saltLen is less than 0

Method Detail

getDigestAlgorithmback to summary
public String getDigestAlgorithm()

Returns the message digest algorithm name.

Returns:String

the message digest algorithm name

Since
1.5
getMGFAlgorithmback to summary
public String getMGFAlgorithm()

Returns the mask generation function algorithm name.

Returns:String

the mask generation function algorithm name

Since
1.5
getMGFParametersback to summary
public AlgorithmParameterSpec getMGFParameters()

Returns the parameters for the mask generation function.

Returns:AlgorithmParameterSpec

the parameters for the mask generation function

Since
1.5
getSaltLengthback to summary
public int getSaltLength()

Returns the salt length in bytes.

Returns:int

the salt length

getTrailerFieldback to summary
public int getTrailerField()

Returns the value for the trailer field.

Returns:int

the value for the trailer field

Since
1.5
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override