1. /*
  2. * @(#)DSAPrivateKeySpec.java 1.15 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.security.spec;
  11. import java.math.BigInteger;
  12. /**
  13. * This class specifies a DSA private key with its associated parameters.
  14. *
  15. * @author Jan Luehe
  16. *
  17. * @version 1.15, 02/02/00
  18. *
  19. * @see java.security.Key
  20. * @see java.security.KeyFactory
  21. * @see KeySpec
  22. * @see DSAPublicKeySpec
  23. * @see PKCS8EncodedKeySpec
  24. *
  25. * @since 1.2
  26. */
  27. public class DSAPrivateKeySpec implements KeySpec {
  28. private BigInteger x;
  29. private BigInteger p;
  30. private BigInteger q;
  31. private BigInteger g;
  32. /**
  33. * Creates a new DSAPrivateKeySpec with the specified parameter values.
  34. *
  35. * @param x the private key.
  36. *
  37. * @param p the prime.
  38. *
  39. * @param q the sub-prime.
  40. *
  41. * @param g the base.
  42. */
  43. public DSAPrivateKeySpec(BigInteger x, BigInteger p, BigInteger q,
  44. BigInteger g) {
  45. this.x = x;
  46. this.p = p;
  47. this.q = q;
  48. this.g = g;
  49. }
  50. /**
  51. * Returns the private key <code>x</code>.
  52. *
  53. * @return the private key <code>x</code>.
  54. */
  55. public BigInteger getX() {
  56. return this.x;
  57. }
  58. /**
  59. * Returns the prime <code>p</code>.
  60. *
  61. * @return the prime <code>p</code>.
  62. */
  63. public BigInteger getP() {
  64. return this.p;
  65. }
  66. /**
  67. * Returns the sub-prime <code>q</code>.
  68. *
  69. * @return the sub-prime <code>q</code>.
  70. */
  71. public BigInteger getQ() {
  72. return this.q;
  73. }
  74. /**
  75. * Returns the base <code>g</code>.
  76. *
  77. * @return the base <code>g</code>.
  78. */
  79. public BigInteger getG() {
  80. return this.g;
  81. }
  82. }