Join us for ⁠#Android11: The Beta Launch Show on June 3!
Added in API level 1

PSSParameterSpec

open class PSSParameterSpec : AlgorithmParameterSpec
kotlin.Any
   ↳ java.security.spec.PSSParameterSpec

This class specifies a parameter spec for RSA-PSS signature scheme, as defined in the PKCS#1 v2.1 standard.

Its ASN.1 definition in PKCS#1 standard is described below:

RSASSA-PSS-params ::= SEQUENCE {
    hashAlgorithm      [0] OAEP-PSSDigestAlgorithms  DEFAULT sha1,
    maskGenAlgorithm   [1] PKCS1MGFAlgorithms  DEFAULT mgf1SHA1,
    saltLength         [2] INTEGER  DEFAULT 20,
    trailerField       [3] INTEGER  DEFAULT 1
  }
  
where
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 },
    ...  -- Allows for future expansion --
  }
 
  PKCS1MGFAlgorithms    ALGORITHM-IDENTIFIER ::= {
    { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
    ...  -- 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

Public constructors

<init>(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.

<init>(saltLen: Int)

Creates a new PSSParameterSpec using the specified salt length and other default values as defined in PKCS#1.

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 bits.

open Int

Returns the value for the trailer field, i.

Properties

static PSSParameterSpec!

The PSS parameter set with all default values.

Public constructors

<init>

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

<init>

Added in API level 1
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 bits to be used in PKCS#1 PSS encoding.
Exceptions
java.lang.IllegalArgumentException if saltLen is less than 0.

Public methods

getDigestAlgorithm

Added in API level 1
open fun getDigestAlgorithm(): String!

Returns the message digest algorithm name.

Return
String! the message digest algorithm name.

getMGFAlgorithm

Added in API level 1
open fun getMGFAlgorithm(): String!

Returns the mask generation function algorithm name.

Return
String! the mask generation function algorithm name.

getMGFParameters

Added in API level 1
open fun getMGFParameters(): AlgorithmParameterSpec!

Returns the parameters for the mask generation function.

Return
AlgorithmParameterSpec! the parameters for the mask generation function.

getSaltLength

Added in API level 1
open fun getSaltLength(): Int

Returns the salt length in bits.

Return
Int the salt length.

getTrailerField

Added in API level 1
open fun getTrailerField(): Int

Returns the value for the trailer field, i.e. bc in PKCS#1 v2.1.

Return
Int the value for the trailer field, i.e. bc in PKCS#1 v2.1.

Properties

DEFAULT

Added in API level 1
static val DEFAULT: PSSParameterSpec!

The PSS parameter set with all default values.