1. /*
  2. * @(#)RSAPrivateKeySpec.java 1.5 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.
  11. *
  12. * @author Jan Luehe
  13. *
  14. * @version 1.5 01/11/29
  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. public RSAPrivateKeySpec(BigInteger modulus, BigInteger privateExponent) {
  27. this.modulus = modulus;
  28. this.privateExponent = privateExponent;
  29. }
  30. /**
  31. * Returns the modulus.
  32. *
  33. * @return the modulus
  34. */
  35. public BigInteger getModulus() {
  36. return this.modulus;
  37. }
  38. /**
  39. * Returns the private exponent.
  40. *
  41. * @return the private exponent
  42. */
  43. public BigInteger getPrivateExponent() {
  44. return this.privateExponent;
  45. }
  46. }