1. /*
  2. * @(#)RSAPublicKeySpec.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 public 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 X509EncodedKeySpec
  20. * @see RSAPrivateKeySpec
  21. * @see RSAPrivateCrtKeySpec
  22. */
  23. public class RSAPublicKeySpec implements KeySpec {
  24. private BigInteger modulus;
  25. private BigInteger publicExponent;
  26. public RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent) {
  27. this.modulus = modulus;
  28. this.publicExponent = publicExponent;
  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 public exponent.
  40. *
  41. * @return the public exponent
  42. */
  43. public BigInteger getPublicExponent() {
  44. return this.publicExponent;
  45. }
  46. }