1. /*
  2. * @(#)RSAPublicKeySpec.java 1.9 03/01/23
  3. *
  4. * Copyright 2003 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 public key.
  11. *
  12. * @author Jan Luehe
  13. *
  14. * @version 1.9 03/01/23
  15. *
  16. * @see java.security.Key
  17. * @see java.security.KeyFactory
  18. * @see KeySpec
  19. * @see X509EncodedKeySpec
  20. * @see RSAPrivateKeySpec
  21. * @see RSAPrivateCrtKeySpec
  22. */
  23. public class RSAPublicKeySpec implements KeySpec {
  24. private BigInteger modulus;
  25. private BigInteger publicExponent;
  26. /**
  27. * Creates a new RSAPublicKeySpec.
  28. *
  29. * @param modulus the modulus
  30. * @param publicExponent the public exponent
  31. */
  32. public RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent) {
  33. this.modulus = modulus;
  34. this.publicExponent = publicExponent;
  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 public exponent.
  46. *
  47. * @return the public exponent
  48. */
  49. public BigInteger getPublicExponent() {
  50. return this.publicExponent;
  51. }
  52. }