aboutsummaryrefslogtreecommitdiffstats
path: root/libraries/spongycastle/prov/src/main/jdk1.3/org/spongycastle/jce/spec/PSSParameterSpec.java
blob: 0711e29c8aabde6a48c080ca6176579d88df5d32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.spongycastle.jce.spec;

/**
 * This class specifies a parameter spec for RSA PSS encoding scheme,
 * as defined in the PKCS#1 v2.1.
 *
 * @see java.security.spec.AlgorithmParameterSpec
 * @see java.security.Signature
 */
public class PSSParameterSpec
    extends Object
    implements java.security.spec.AlgorithmParameterSpec
{
    private int saltLen;

    /**
     * Creates a new PSSParameterSpec given the salt length as defined
     * in PKCS#1. 
     *
     * @param saltLen - the length of salt in bits to be used in PKCS#1
     *    PSS encoding. 
     * @throws IllegalArgumentException - if saltLen is less than 0.
     */
    public PSSParameterSpec(int saltLen)
    {
        if (saltLen < 0)
        {
            throw new IllegalArgumentException("Salt length must be >= 0");
        }

        this.saltLen = saltLen;
    }

    /**
     * Returns the salt length in bits. 
     * 
     * @returns the salt length.
     */
    public int getSaltLength()
    {
        return saltLen;
    }
}