1. /*
  2. * @(#)RSAPrivateCrtKeySpec.java 1.6 01/11/29
  3. *
  4. * Copyright 2002 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 an RSA private key, as defined in the PKCS#1
  11. * standard, using the <i>Chinese Remainder Theorem</i> (CRT) information
  12. * values.
  13. *
  14. * @author Jan Luehe
  15. *
  16. * @version 1.6 01/11/29
  17. *
  18. * @see java.security.Key
  19. * @see java.security.KeyFactory
  20. * @see KeySpec
  21. * @see PKCS8EncodedKeySpec
  22. * @see RSAPrivateKeySpec
  23. * @see RSAPublicKeySpec
  24. */
  25. public class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec {
  26. private BigInteger modulus;
  27. private BigInteger publicExponent;
  28. private BigInteger privateExponent;
  29. private BigInteger primeP;
  30. private BigInteger primeQ;
  31. private BigInteger primeExponentP;
  32. private BigInteger primeExponentQ;
  33. private BigInteger crtCoefficient;
  34. public RSAPrivateCrtKeySpec(BigInteger modulus,
  35. BigInteger publicExponent,
  36. BigInteger privateExponent,
  37. BigInteger primeP,
  38. BigInteger primeQ,
  39. BigInteger primeExponentP,
  40. BigInteger primeExponentQ,
  41. BigInteger crtCoefficient) {
  42. super(modulus, privateExponent);
  43. this.publicExponent = publicExponent;
  44. this.primeP = primeP;
  45. this.primeQ = primeQ;
  46. this.primeExponentP = primeExponentP;
  47. this.primeExponentQ = primeExponentQ;
  48. this.crtCoefficient = crtCoefficient;
  49. }
  50. /**
  51. * Returns the public exponent.
  52. *
  53. * @return the public exponent
  54. */
  55. public BigInteger getPublicExponent() {
  56. return this.publicExponent;
  57. }
  58. /**
  59. * Returns the primeP.
  60. * @return the primeP
  61. */
  62. public BigInteger getPrimeP() {
  63. return this.primeP;
  64. }
  65. /**
  66. * Returns the primeQ.
  67. *
  68. * @return the primeQ
  69. */
  70. public BigInteger getPrimeQ() {
  71. return this.primeQ;
  72. }
  73. /**
  74. * Returns the primeExponentP.
  75. *
  76. * @return the primeExponentP
  77. */
  78. public BigInteger getPrimeExponentP() {
  79. return this.primeExponentP;
  80. }
  81. /**
  82. * Returns the primeExponentQ.
  83. *
  84. * @return the primeExponentQ
  85. */
  86. public BigInteger getPrimeExponentQ() {
  87. return this.primeExponentQ;
  88. }
  89. /**
  90. * Returns the crtCoefficient.
  91. *
  92. * @return the crtCoefficient
  93. */
  94. public BigInteger getCrtCoefficient() {
  95. return this.crtCoefficient;
  96. }
  97. }