FileDocCategorySizeDatePackage
PSSParameterSpec.javaAPI DocAndroid 1.5 API5647Wed May 06 22:41:06 BST 2009java.security.spec

PSSParameterSpec

public class PSSParameterSpec extends Object implements AlgorithmParameterSpec
The parameter specification for the RSA-PSS Signature scheme.

Defined in the PKCS #1 v2.1 standard.

since
Android 1.0

Fields Summary
public static final PSSParameterSpec
DEFAULT
The default parameter specification. It specifies the following parameters:
  • message digest: {@code "SHA-1"}
  • mask generation function (mgf): {@code "MGF1"}
  • parameters for the mgf: {@link MGF1ParameterSpec#SHA1}
  • salt length: {@code 20}
  • trailer field: {@code -1}
private final String
mdName
private final String
mgfName
private final AlgorithmParameterSpec
mgfSpec
private final int
trailerField
private final int
saltLen
Constructors Summary
public PSSParameterSpec(int saltLen)
Creates a new {@code PSSParameterSpec} with the specified salt length and the default values.

param
saltLen the salt length (in bits).
throws
IllegalArgumentException if {@code saltLen} is negative.
since
Android 1.0


                                                                 
       
        if (saltLen < 0) {
            throw new IllegalArgumentException(Messages.getString("security.7F")); //$NON-NLS-1$
        }
        this.saltLen = saltLen;
        this.mdName = "SHA-1"; //$NON-NLS-1$
        this.mgfName = "MGF1"; //$NON-NLS-1$
        this.mgfSpec = MGF1ParameterSpec.SHA1;
        this.trailerField = 1;
    
public PSSParameterSpec(String mdName, String mgfName, AlgorithmParameterSpec mgfSpec, int saltLen, int trailerField)
Creates a new {@code PSSParameterSpec} with the specified message digest name, mask generation function name, mask generation function parameters, salt length, and trailer field value.

param
mdName the name of the message digest algorithm.
param
mgfName the name of the mask generation function algorithm.
param
mgfSpec the parameter for the mask generation function algorithm.
param
saltLen the salt length (in bits).
param
trailerField the trailer field value.
throws
IllegalArgumentException if {@code saltLen} or {@code trailerField} is negative.
since
Android 1.0


        if (mdName == null) {
            throw new NullPointerException(Messages.getString("security.80")); //$NON-NLS-1$
        }
        if (mgfName == null) {
            throw new NullPointerException(Messages.getString("security.81")); //$NON-NLS-1$
        }
        if (saltLen < 0) {
            throw new IllegalArgumentException(Messages.getString("security.7F")); //$NON-NLS-1$
        }
        if (trailerField < 0) {
            throw new IllegalArgumentException(Messages.getString("security.82")); //$NON-NLS-1$
        }
        this.mdName = mdName;
        this.mgfName = mgfName;
        this.mgfSpec = mgfSpec;
        this.saltLen = saltLen;
        this.trailerField = trailerField;
    
Methods Summary
public java.lang.StringgetDigestAlgorithm()
Returns the name of the message digest algorithm.

return
the name of the message digest algorithm.
since
Android 1.0

        return mdName;
    
public java.lang.StringgetMGFAlgorithm()
Returns the name of the mask generation function algorithm.

return
the name of the mask generation function algorithm.
since
Android 1.0

        return mgfName;
    
public java.security.spec.AlgorithmParameterSpecgetMGFParameters()
Returns the parameter for the mask generation function algorithm.

return
the parameter for the mask generation function algorithm, or {@code null} if none specified.
since
Android 1.0

        return mgfSpec;
    
public intgetSaltLength()
Returns the length of the salt (in bits).

return
the length of the salt (in bits).
since
Android 1.0

        return saltLen;
    
public intgetTrailerField()
Returns the trailer field value.

return
the trailer field value.
since
Android 1.0

        return trailerField;