de.flexiprovider.core.rsa
Class PSSParameterSpec

java.lang.Object
  |
  +--de.flexiprovider.core.rsa.PSSParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec, java.security.spec.AlgorithmParameterSpec
Direct Known Subclasses:
PSSParameterSpec.SHA1, PSSParameterSpec.SHA256

public class PSSParameterSpec
extends java.lang.Object
implements AlgorithmParameterSpec

This class specifies parameters for the RSASSA-PSS signature algorithm (implemented by RSASignaturePSS). The parameters consist of the OIDs of a hash function and a mask generation function, a salt length, and a trailer field value.

The default hash function is SHA1 (1.3.14.3.2.26). The only supported mask generation function is MGF1 (1.2.840.113549.1.1.8). The default salt length is 20 bytes. The only supported trailer field value is trailerFieldBC(1).

Author:
Martin Döring

Inner Class Summary
static class PSSParameterSpec.SHA1
          Parameter set (md = "1.3.14.3.2.26" (SHA1), saltLen = 20)
static class PSSParameterSpec.SHA256
          Parameter set (md = "2.16.840.1.101.3.4.2.1" (SHA256), saltLen = 32)
 
Field Summary
static java.lang.String DEFAULT_MD
          The OID of the default message digest (SHA1, 1.3.14.3.2.26)
static java.lang.String DEFAULT_MGF
          The OID of the default mask generation function (MGF1)
static int DEFAULT_SALT_LENGTH
          The default salt length (20 bytes)
static int DEFAULT_TRAILER_FIELD
          The default trailer field (trailerFieldBC, value 1)
 
Constructor Summary
PSSParameterSpec()
          Construct the default PSS parameters.
PSSParameterSpec(java.lang.String md, int saltLength)
          Construct new PSS parameters from the given name of the message digest and salt length.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare the parameters with another object
 java.lang.String getMD()
           
 int getSaltLength()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_MD

public static final java.lang.String DEFAULT_MD
The OID of the default message digest (SHA1, 1.3.14.3.2.26)

DEFAULT_MGF

public static final java.lang.String DEFAULT_MGF
The OID of the default mask generation function (MGF1)

DEFAULT_SALT_LENGTH

public static final int DEFAULT_SALT_LENGTH
The default salt length (20 bytes)

DEFAULT_TRAILER_FIELD

public static final int DEFAULT_TRAILER_FIELD
The default trailer field (trailerFieldBC, value 1)
Constructor Detail

PSSParameterSpec

public PSSParameterSpec()
Construct the default PSS parameters. Choose the DEFAULT_MD and the DEFAULT_SALT_LENGTH.

PSSParameterSpec

public PSSParameterSpec(java.lang.String md,
                        int saltLength)
Construct new PSS parameters from the given name of the message digest and salt length. If the message digest name is invalid, choose the DEFAULT_MD. If the salt length is invalid, choose the DEFAULT_SALT_LENGTH.
Parameters:
md - the name of the message digest
saltLength - the salt length (in bytes)
Method Detail

getMD

public java.lang.String getMD()
Returns:
the OID of the message digest

getSaltLength

public int getSaltLength()
Returns:
the salt length in bytes

equals

public boolean equals(java.lang.Object other)
Compare the parameters with another object
Overrides:
equals in class java.lang.Object
Parameters:
other - the other object
Returns:
the result of the comparison

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the hash code of the parameters

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a human readable form of the parameters