java.lang.Object
java.security.spec.PSSParameterSpec
- 所有已实现的接口:
-
AlgorithmParameterSpec
该类指定了RSASSA-PSS签名方案的参数规范,如PKCS#1 v2.2标准中定义的。
其在PKCS #1标准中的ASN.1定义如下:
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)
}
其中
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 },
... -- 允许未来扩展 --
}
PKCS1MGFAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-mgf1 PARAMETERS HashAlgorithm },
... -- 允许未来扩展 --
}
- 自:
- 1.4
- 参见:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PSSParameterSpec已弃用.该字段使用了PKCS #1标准中定义的默认值。static final int在PKCS #1标准中定义的TrailerFieldBC常量。 -
Constructor Summary
ConstructorsConstructorDescriptionPSSParameterSpec(int saltLen) 已弃用.该构造函数使用了PKCS #1标准中定义的默认值,除了盐长度。PSSParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField) 使用指定的消息摘要、掩码生成函数、掩码生成函数参数、盐长度和尾部字段值创建一个新的PSSParameterSpec,如PKCS #1标准中定义的。 -
Method Summary
Modifier and TypeMethodDescription返回消息摘要算法名称。返回掩码生成函数算法名称。返回掩码生成函数的参数。int返回盐长度(以字节为单位)。int返回尾部字段的值。
-
Field Details
-
TRAILER_FIELD_BC
public static final int TRAILER_FIELD_BC在PKCS #1标准中定义的TrailerFieldBC常量。- 自:
- 11
- 参见:
-
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 the PKCS#1 v2.2 standard for more details. Thus, it is recommended to create a newPSSParameterSpecwith the desired parameter values using thePSSParameterSpec(String, String, AlgorithmParameterSpec, int, int)constructor.具有所有默认值的PSS参数集。- 自:
- 1.5
-
-
Constructor Details
-
PSSParameterSpec
public PSSParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField) 使用指定的消息摘要、掩码生成函数、掩码生成函数参数、盐长度和尾部字段值创建一个新的PSSParameterSpec,如PKCS #1标准中定义的。- 参数:
-
mdName- 哈希函数的算法名称 -
mgfName- 掩码生成函数的算法名称 -
mgfSpec- 掩码生成函数的参数。如果指定为null,则getMGFParameters()将返回null。 -
saltLen- 盐的长度(以字节为单位) -
trailerField- 尾部字段的值 - 抛出:
-
NullPointerException- 如果mdName或mgfName为null -
IllegalArgumentException- 如果saltLen或trailerField小于0 - 自:
- 1.5
-
PSSParameterSpec
Deprecated.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 thePSSParameterSpec(String, String, AlgorithmParameterSpec, int, int)constructor.使用指定的盐长度和PKCS #1标准中定义的其他默认值创建一个新的PSSParameterSpec。- 参数:
-
saltLen- 盐的长度(以字节为单位) - 抛出:
-
IllegalArgumentException- 如果saltLen小于0
-
-
Method Details
-
getDigestAlgorithm
返回消息摘要算法名称。- 返回:
- 消息摘要算法名称
- 自:
- 1.5
-
getMGFAlgorithm
返回掩码生成函数算法名称。- 返回:
- 掩码生成函数算法名称
- 自:
- 1.5
-
getMGFParameters
返回掩码生成函数的参数。- 返回:
- 掩码生成函数的参数
- 自:
- 1.5
-
getSaltLength
public int getSaltLength()返回盐的长度(以字节为单位)。- 返回:
- 盐的长度
-
getTrailerField
public int getTrailerField()返回尾部字段的值。- 返回:
- 尾部字段的值
- 自:
- 1.5
-