1. /*
  2. * @(#)DSAPublicKeySpec.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 public 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 DSAPrivateKeySpec
  23. * @see X509EncodedKeySpec
  24. *
  25. * @since 1.2
  26. */
  27. public class DSAPublicKeySpec implements KeySpec {
  28. private BigInteger y;
  29. private BigInteger p;
  30. private BigInteger q;
  31. private BigInteger g;
  32. /**
  33. * Creates a new DSAPublicKeySpec with the specified parameter values.
  34. *
  35. * @param y the public key.
  36. *
  37. * @param p the prime.
  38. *
  39. * @param q the sub-prime.
  40. *
  41. * @param g the base.
  42. */
  43. public DSAPublicKeySpec(BigInteger y, BigInteger p, BigInteger q,
  44. BigInteger g) {
  45. this.y = y;
  46. this.p = p;
  47. this.q = q;
  48. this.g = g;
  49. }
  50. /**
  51. * Returns the public key <code>y</code>.
  52. *
  53. * @return the public key <code>y</code>.
  54. */
  55. public BigInteger getY() {
  56. return this.y;
  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. }