RSASSA-PSS-params ::= SEQUENCE {
hashAlgorithm [0] OAEP-PSSDigestAlgorithms DEFAULT sha1,
maskGenAlgorithm [1] PKCS1MGFAlgorithms DEFAULT mgf1SHA1,
saltLength [2] INTEGER DEFAULT 20,
trailerField [3] TrailerField DEFAULT trailerFieldBC
}
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 --
}
TrailerField ::= INTEGER { trailerFieldBC(1) }
ASN1EncodableVector v = new ASN1EncodableVector();
if (!hashAlgorithm.equals(DEFAULT_HASH_ALGORITHM))
{
v.add(new DERTaggedObject(true, 0, hashAlgorithm));
}
if (!maskGenAlgorithm.equals(DEFAULT_MASK_GEN_FUNCTION))
{
v.add(new DERTaggedObject(true, 1, maskGenAlgorithm));
}
if (!saltLength.equals(DEFAULT_SALT_LENGTH))
{
v.add(new DERTaggedObject(true, 2, saltLength));
}
if (!trailerField.equals(DEFAULT_TRAILER_FIELD))
{
v.add(new DERTaggedObject(true, 3, trailerField));
}
return new DERSequence(v);