1. /*
  2. * @(#)DSAParameterSpec.java 1.16 03/12/19
  3. *
  4. * Copyright 2004 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 the set of parameters used with the DSA algorithm.
  11. *
  12. * @author Jan Luehe
  13. *
  14. * @version 1.16, 12/19/03
  15. *
  16. * @see AlgorithmParameterSpec
  17. *
  18. * @since 1.2
  19. */
  20. public class DSAParameterSpec implements AlgorithmParameterSpec,
  21. java.security.interfaces.DSAParams {
  22. BigInteger p;
  23. BigInteger q;
  24. BigInteger g;
  25. /**
  26. * Creates a new DSAParameterSpec with the specified parameter values.
  27. *
  28. * @param p the prime.
  29. *
  30. * @param q the sub-prime.
  31. *
  32. * @param g the base.
  33. */
  34. public DSAParameterSpec(BigInteger p, BigInteger q, BigInteger g) {
  35. this.p = p;
  36. this.q = q;
  37. this.g = g;
  38. }
  39. /**
  40. * Returns the prime <code>p</code>.
  41. *
  42. * @return the prime <code>p</code>.
  43. */
  44. public BigInteger getP() {
  45. return this.p;
  46. }
  47. /**
  48. * Returns the sub-prime <code>q</code>.
  49. *
  50. * @return the sub-prime <code>q</code>.
  51. */
  52. public BigInteger getQ() {
  53. return this.q;
  54. }
  55. /**
  56. * Returns the base <code>g</code>.
  57. *
  58. * @return the base <code>g</code>.
  59. */
  60. public BigInteger getG() {
  61. return this.g;
  62. }
  63. }