1. /*
  2. * @(#)PSSParameterSpec.java 1.3 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.security.spec;
  8. import java.math.BigInteger;
  9. /**
  10. * This class specifies a parameter spec for RSA PSS encoding scheme,
  11. * as defined in the PKCS#1 v2.1.
  12. *
  13. * @author Valerie Peng
  14. *
  15. * @version 1.3 03/01/23
  16. *
  17. * @see AlgorithmParameterSpec
  18. * @see java.security.Signature
  19. *
  20. * @since 1.4
  21. */
  22. public class PSSParameterSpec implements AlgorithmParameterSpec {
  23. private int saltLen = 0;
  24. /**
  25. * Creates a new <code>PSSParameterSpec</code>
  26. * given the salt length as defined in PKCS#1.
  27. *
  28. * @param saltLen the length of salt in bits to be used in PKCS#1
  29. * PSS encoding.
  30. * @exception IllegalArgumentException if <code>saltLen</code> is
  31. * less than 0.
  32. */
  33. public PSSParameterSpec(int saltLen) {
  34. if (saltLen < 0) {
  35. throw new IllegalArgumentException("invalid saltLen value");
  36. }
  37. this.saltLen = saltLen;
  38. }
  39. /**
  40. * Returns the salt length in bits.
  41. *
  42. * @return the salt length.
  43. */
  44. public int getSaltLength() {
  45. return saltLen;
  46. }
  47. }