java.lang.Object
javax.crypto.spec.OAEPParameterSpec
- 所有已实现的接口:
-
AlgorithmParameterSpec
该类指定了与OAEP填充一起使用的参数集,如PKCS#1 v2.2标准中定义的那样。其在PKCS#1标准中的ASN.1定义如下:
RSAES-OAEP-params ::= SEQUENCE {
hashAlgorithm [0] HashAlgorithm DEFAULT sha1,
maskGenAlgorithm [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
pSourceAlgorithm [2] PSourceAlgorithm DEFAULT pSpecifiedEmpty
}
其中
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 },
... -- 允许未来扩展 --
}
PKCS1MGFAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-mgf1 PARAMETERS HashAlgorithm },
... -- 允许未来扩展 --
}
PKCS1PSourceAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-pSpecified PARAMETERS EncodingParameters },
... -- 允许未来扩展 --
}
EncodingParameters ::= OCTET STRING(SIZE(0..MAX))
- 自JDK版本:
- 1.5
- 参见:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOAEPParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, PSource pSrc) 使用指定的消息摘要算法mdName、掩码生成函数算法mgfName、掩码生成函数的参数mgfSpec和编码输入P的来源pSrc构造PKCS#1标准中定义的OAEP填充的参数集。 -
Method Summary
Modifier and TypeMethodDescription返回消息摘要算法名称。返回掩码生成函数算法名称。返回掩码生成函数的参数。返回编码输入P的来源。
-
Field Details
-
DEFAULT
Deprecated.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 newOAEPParameterSpecwith the desired parameter values using theOAEPParameterSpec(String, String, AlgorithmParameterSpec, PSource)constructor.OAEP参数集的所有默认值,即消息摘要算法为"SHA-1",掩码生成函数(mgf)算法为"MGF1",掩码生成函数的参数为MGF1ParameterSpec.SHA1,编码输入的来源为PSource.PSpecified.DEFAULT。
-
-
Constructor Details
-
OAEPParameterSpec
public OAEPParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, PSource pSrc) 使用指定的消息摘要算法mdName、掩码生成函数算法mgfName、掩码生成函数的参数mgfSpec和编码输入P的来源pSrc构造PKCS#1标准中定义的OAEP填充的参数集。- 参数:
-
mdName- 消息摘要的算法名称 -
mgfName- 掩码生成函数的算法名称 -
mgfSpec- 掩码生成函数的参数;如果指定了null,则getMGFParameters()将返回null -
pSrc- 编码输入P的来源 - 抛出:
-
NullPointerException- 如果mdName、mgfName或pSrc为null
-
-
Method Details
-
getDigestAlgorithm
返回消息摘要算法名称。- 返回:
- 消息摘要算法名称。
-
getMGFAlgorithm
返回掩码生成函数算法名称。- 返回:
- 掩码生成函数算法名称。
-
getMGFParameters
返回掩码生成函数的参数。- 返回:
- 掩码生成函数的参数。
-
getPSource
返回编码输入P的来源。- 返回:
- 编码输入P的来源。
-