PSSParameterSpec
open class PSSParameterSpec : AlgorithmParameterSpec
kotlin.Any | |
↳ | java.security.spec.PSSParameterSpec |
This class specifies a parameter spec for RSASSA-PSS signature scheme, as defined in the PKCS#1 v2.2 standard.
Its ASN.1 definition in PKCS#1 standard is described below:
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 }, ... -- Allows for future expansion -- } PKCS1MGFAlgorithms ALGORITHM-IDENTIFIER ::= { { OID id-mgf1 PARAMETERS HashAlgorithm }, ... -- Allows for future expansion -- }
Note: the PSSParameterSpec.DEFAULT uses the following: message digest -- "SHA-1" mask generation function (mgf) -- "MGF1" parameters for mgf -- MGF1ParameterSpec.SHA1 SaltLength -- 20 TrailerField -- 1
Summary
Constants | |
---|---|
static Int |
The |
Public constructors | |
---|---|
PSSParameterSpec(saltLen: Int) Creates a new |
|
PSSParameterSpec(mdName: String!, mgfName: String!, mgfSpec: AlgorithmParameterSpec!, saltLen: Int, trailerField: Int) Creates a new |
Public methods | |
---|---|
open String! |
Returns the message digest algorithm name. |
open String! |
Returns the mask generation function algorithm name. |
open AlgorithmParameterSpec! |
Returns the parameters for the mask generation function. |
open Int |
Returns the salt length in bytes. |
open Int |
Returns the value for the trailer field. |
open String |
toString() |
Properties | |
---|---|
static PSSParameterSpec! |
The PSS parameter set with all default values |
Constants
TRAILER_FIELD_BC
static val TRAILER_FIELD_BC: Int
The TrailerFieldBC
constant as defined in PKCS#1
Value: 1
Public constructors
PSSParameterSpec
PSSParameterSpec(saltLen: Int)
Creates a new PSSParameterSpec
using the specified salt length and other default values as defined in PKCS#1.
Parameters | |
---|---|
saltLen |
Int: the length of salt in bytes to be used in PKCS#1 PSS encoding |
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if saltLen is less than 0 |
PSSParameterSpec
PSSParameterSpec(
mdName: String!,
mgfName: String!,
mgfSpec: AlgorithmParameterSpec!,
saltLen: Int,
trailerField: Int)
Creates a new PSSParameterSpec
as defined in the PKCS #1 standard using the specified message digest, mask generation function, parameters for mask generation function, salt length, and trailer field values.
Parameters | |
---|---|
mdName |
String!: the algorithm name of the hash function |
mgfName |
String!: the algorithm name of the mask generation function |
mgfSpec |
AlgorithmParameterSpec!: the parameters for the mask generation function. If null is specified, null will be returned by getMGFParameters(). |
saltLen |
Int: the length of salt |
trailerField |
Int: the value of the trailer field |
Exceptions | |
---|---|
java.lang.NullPointerException |
if mdName , or mgfName is null |
java.lang.IllegalArgumentException |
if saltLen or trailerField is less than 0 |
Public methods
getDigestAlgorithm
open fun getDigestAlgorithm(): String!
Returns the message digest algorithm name.
Return | |
---|---|
String! |
the message digest algorithm name |
getMGFAlgorithm
open fun getMGFAlgorithm(): String!
Returns the mask generation function algorithm name.
Return | |
---|---|
String! |
the mask generation function algorithm name |
getMGFParameters
open fun getMGFParameters(): AlgorithmParameterSpec!
Returns the parameters for the mask generation function.
Return | |
---|---|
AlgorithmParameterSpec! |
the parameters for the mask generation function |
getSaltLength
open fun getSaltLength(): Int
Returns the salt length in bytes.
Return | |
---|---|
Int |
the salt length |
getTrailerField
open fun getTrailerField(): Int
Returns the value for the trailer field.
Return | |
---|---|
Int |
the value for the trailer field |
toString
open fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
Properties
DEFAULT
static val DEFAULT: PSSParameterSpec!
The PSS parameter set with all default values