APIdia Launch Partner
Top Description Fields Constructors Methods
javax.crypto.spec

public Class OAEPParameterSpec

extends Object
implements AlgorithmParameterSpec
Class Inheritance
All Implemented Interfaces
java.security.spec.AlgorithmParameterSpec
Imports
java.security.spec.AlgorithmParameterSpec, .MGF1ParameterSpec

This class specifies the set of parameters used with OAEP Padding, as defined in the PKCS#1 v2.2 standard. Its ASN.1 definition in PKCS#1 standard is described below:
RSAES-OAEP-params ::= SEQUENCE {
  hashAlgorithm      [0] HashAlgorithm     DEFAULT sha1,
  maskGenAlgorithm   [1] MaskGenAlgorithm  DEFAULT mgf1SHA1,
  pSourceAlgorithm   [2] PSourceAlgorithm  DEFAULT pSpecifiedEmpty
}
where
HashAlgorithm ::= AlgorithmIdentifier {
  {OAEP-PSSDigestAlgorithms}
}
MaskGenAlgorithm ::= AlgorithmIdentifier { {PKCS1MGFAlgorithms} }
PSourceAlgorithm ::= AlgorithmIdentifier {
  {PKCS1PSourceAlgorithms}
}

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 --
}
PKCS1PSourceAlgorithms    ALGORITHM-IDENTIFIER ::= {
  { OID id-pSpecified PARAMETERS EncodingParameters },
  ...  -- Allows for future expansion --
}
EncodingParameters ::= OCTET STRING(SIZE(0..MAX))
Author
Valerie Peng
Since
1.5
External Specification
https://www.rfc-editor.org/info/rfc8017
See Also
java.security.spec.MGF1ParameterSpec, PSource

Field Summary

Modifier and TypeField and Description
public static final OAEPParameterSpec
DEFAULT

Deprecated since 19. This field uses the default values defined in the PKCS #1 standard.
The OAEP parameter set with all default values, i.e. "SHA-1" as message digest algorithm, "MGF1" as mask generation function (mgf) algorithm, MGF1ParameterSpec.SHA1 as parameters for the mask generation function, and PSource.PSpecified.DEFAULT as the source of the encoding input.
private final String
private final String
private final AlgorithmParameterSpec
private final PSource

Constructor Summary

AccessConstructor and Description
public
OAEPParameterSpec(String
the algorithm name for the message digest
mdName
,
String
the algorithm name for the mask generation function
mgfName
,
AlgorithmParameterSpec
the parameters for the mask generation function; if null is specified, null will be returned by getMGFParameters()
mgfSpec
,
PSource
the source of the encoding input P
pSrc
)

Constructs a parameter set for OAEP padding as defined in the PKCS #1 standard using the specified message digest algorithm mdName, mask generation function algorithm mgfName, parameters for the mask generation function mgfSpec, and source of the encoding input P pSrc.

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 PSource

Returns:

the source of encoding input P.
getPSource
()

Returns the source of encoding input P.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULTback to summary
public static final OAEPParameterSpec 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 Appendix B.1 of PKCS #1 for more details. Thus, it is recommended to create a new OAEPParameterSpec with the desired parameter values using the OAEPParameterSpec(String, String, AlgorithmParameterSpec, PSource) constructor.

The OAEP parameter set with all default values, i.e. "SHA-1" as message digest algorithm, "MGF1" as mask generation function (mgf) algorithm, MGF1ParameterSpec.SHA1 as parameters for the mask generation function, and PSource.PSpecified.DEFAULT as the source of the encoding input.

Annotations
@Deprecated
since:19
mdNameback to summary
private final String mdName
mgfNameback to summary
private final String mgfName
mgfSpecback to summary
private final AlgorithmParameterSpec mgfSpec
pSrcback to summary
private final PSource pSrc

Constructor Detail

OAEPParameterSpecback to summary
public OAEPParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, PSource pSrc)

Constructs a parameter set for OAEP padding as defined in the PKCS #1 standard using the specified message digest algorithm mdName, mask generation function algorithm mgfName, parameters for the mask generation function mgfSpec, and source of the encoding input P pSrc.

Parameters
mdName:String

the algorithm name for the message digest

mgfName:String

the algorithm name for the mask generation function

mgfSpec:AlgorithmParameterSpec

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

pSrc:PSource

the source of the encoding input P

Exceptions
NullPointerException:
if mdName, mgfName, or pSrc is null

Method Detail

getDigestAlgorithmback to summary
public String getDigestAlgorithm()

Returns the message digest algorithm name.

Returns:String

the message digest algorithm name.

getMGFAlgorithmback to summary
public String getMGFAlgorithm()

Returns the mask generation function algorithm name.

Returns:String

the mask generation function algorithm name.

getMGFParametersback to summary
public AlgorithmParameterSpec getMGFParameters()

Returns the parameters for the mask generation function.

Returns:AlgorithmParameterSpec

the parameters for the mask generation function.

getPSourceback to summary
public PSource getPSource()

Returns the source of encoding input P.

Returns:PSource

the source of encoding input P.