Most visited

Recently visited

Added in API level 1

OAEPParameterSpec

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

也可以看看:

Summary

Fields

public static final OAEPParameterSpec DEFAULT

使用所有默认值设置OAEP参数。

Public constructors

OAEPParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, PSource pSrc)

构造为使用指定的消息摘要算法在PKCS#1标准中定义的OAEP冗余参数集 mdName ,掩码生成函数算法 mgfName ,掩码生成函数参数 mgfSpec编码输入P的,和源 pSrc 。

Public methods

String getDigestAlgorithm()

返回消息摘要算法名称。

String getMGFAlgorithm()

返回掩码生成函数算法名称。

AlgorithmParameterSpec getMGFParameters()

返回遮罩生成函数的参数。

PSource getPSource()

返回编码输入的源P.

Inherited methods

From class java.lang.Object

Fields

DEFAULT

Added in API level 1
OAEPParameterSpec DEFAULT

使用所有默认值设置OAEP参数。

Public constructors

OAEPParameterSpec

Added in API level 1
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.

Public methods

getDigestAlgorithm

Added in API level 1
String getDigestAlgorithm ()

返回消息摘要算法名称。

Returns
String the message digest algorithm name.

getMGFAlgorithm

Added in API level 1
String getMGFAlgorithm ()

返回掩码生成函数算法名称。

Returns
String the mask generation function algorithm name.

getMGFParameters

Added in API level 1
AlgorithmParameterSpec getMGFParameters ()

返回遮罩生成函数的参数。

Returns
AlgorithmParameterSpec the parameters for the mask generation function.

getPSource

Added in API level 1
PSource getPSource ()

返回编码输入的源P.

Returns
PSource the source of encoding input P.

Hooray!