public class OAEPParameterSpec
extends Object implements AlgorithmParameterSpec
| java.lang.Object | |
| javax.crypto.spec.OAEPParameterSpec | |
该类指定了与OAEP填充一起使用的一组参数,如PKCS #1标准中所定义的。 其在PKCS#1标准中的ASN.1定义如下:
RSAES-OAEP-params ::= SEQUENCE {
hashAlgorithm [0] OAEP-PSSDigestAlgorithms DEFAULT sha1,
maskGenAlgorithm [1] PKCS1MGFAlgorithms DEFAULT mgf1SHA1,
pSourceAlgorithm [2] PKCS1PSourceAlgorithms DEFAULT pSpecifiedEmpty
}
where
OAEP-PSSDigestAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-sha1 PARAMETERS NULL }|
{ OID id-sha256 PARAMETERS NULL }|
{ OID id-sha384 PARAMETERS NULL }|
{ OID id-sha512 PARAMETERS NULL },
... -- Allows for future expansion --
}
PKCS1MGFAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
... -- Allows for future expansion --
}
PKCS1PSourceAlgorithms ALGORITHM-IDENTIFIER ::= {
{ OID id-pSpecified PARAMETERS OCTET STRING },
... -- Allows for future expansion --
}
注意:OAEPParameterSpec.DEFAULT使用以下内容:消息摘要 - 用于mgf的“SHA-1”掩码生成功能(mgf) - “MGF1”参数 - MGF1ParameterSpec.SHA1编码输入源 - PSource.PSpecified.DEFAULT
也可以看看:
Fields |
|
|---|---|
public static final OAEPParameterSpec |
DEFAULT 使用所有默认值设置OAEP参数。 |
Public constructors |
|
|---|---|
OAEPParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, PSource pSrc) 构造为使用指定的消息摘要算法在PKCS#1标准中定义的OAEP冗余参数集 |
|
公共方法(Public methods) |
|
|---|---|
String |
getDigestAlgorithm() 返回消息摘要算法名称。 |
String |
getMGFAlgorithm() 返回掩码生成函数算法名称。 |
AlgorithmParameterSpec |
getMGFParameters() 返回遮罩生成函数的参数。 |
PSource |
getPSource() 返回编码输入的源P. |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
OAEPParameterSpec (String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, PSource pSrc)
构造为使用指定的消息摘要算法在PKCS#1标准中定义的OAEP冗余参数集 mdName ,掩码生成函数算法 mgfName ,掩码生成函数参数 mgfSpec编码输入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. |
| 抛出异常(Throws) | |
|---|---|
NullPointerException |
if mdName, mgfName, or pSrc is null. |
String getDigestAlgorithm ()
返回消息摘要算法名称。
| 返回(Returns) | |
|---|---|
String |
the message digest algorithm name. |
String getMGFAlgorithm ()
返回掩码生成函数算法名称。
| 返回(Returns) | |
|---|---|
String |
the mask generation function algorithm name. |
AlgorithmParameterSpec getMGFParameters ()
返回遮罩生成函数的参数。
| 返回(Returns) | |
|---|---|
AlgorithmParameterSpec |
the parameters for the mask generation function. |
PSource getPSource ()
返回编码输入的源P.
| 返回(Returns) | |
|---|---|
PSource |
the source of encoding input P. |