1. /*
  2. * @(#)RSAPrivateKeySpec.java 1.10 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 an RSA private key.
  11. *
  12. * @author Jan Luehe
  13. *
  14. * @version 1.10 03/12/19
  15. *
  16. * @see java.security.Key
  17. * @see java.security.KeyFactory
  18. * @see KeySpec
  19. * @see PKCS8EncodedKeySpec
  20. * @see RSAPublicKeySpec
  21. * @see RSAPrivateCrtKeySpec
  22. */
  23. public class RSAPrivateKeySpec implements KeySpec {
  24. private BigInteger modulus;
  25. private BigInteger privateExponent;
  26. /**
  27. * Creates a new RSAPrivateKeySpec.
  28. *
  29. * @param modulus the modulus
  30. * @param privateExponent the private exponent
  31. */
  32. public RSAPrivateKeySpec(BigInteger modulus, BigInteger privateExponent) {
  33. this.modulus = modulus;
  34. this.privateExponent = privateExponent;
  35. }
  36. /**
  37. * Returns the modulus.
  38. *
  39. * @return the modulus
  40. */
  41. public BigInteger getModulus() {
  42. return this.modulus;
  43. }
  44. /**
  45. * Returns the private exponent.
  46. *
  47. * @return the private exponent
  48. */
  49. public BigInteger getPrivateExponent() {
  50. return this.privateExponent;
  51. }
  52. }