1. /*
  2. * @(#)RSAKeyGenParameterSpec.java 1.7 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. import java.security.spec.AlgorithmParameterSpec;
  10. /**
  11. * This class specifies the set of parameters used to generate an RSA
  12. * key pair.
  13. *
  14. * @author Jan Luehe
  15. * @version 1.7 01/23/03
  16. *
  17. * @see java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
  18. *
  19. * @since 1.3
  20. */
  21. public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec {
  22. private int keysize;
  23. private BigInteger publicExponent;
  24. /**
  25. * The public-exponent value F0 = 3.
  26. */
  27. public static final BigInteger F0 = BigInteger.valueOf(3);
  28. /**
  29. * The public exponent-value F4 = 65537.
  30. */
  31. public static final BigInteger F4 = BigInteger.valueOf(65537);
  32. /**
  33. * Constructs a new <code>RSAParameterSpec</code> object from the
  34. * given keysize and public-exponent value.
  35. *
  36. * @param keysize the modulus size (specified in number of bits)
  37. * @param publicExponent the public exponent
  38. */
  39. public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent) {
  40. this.keysize = keysize;
  41. this.publicExponent = publicExponent;
  42. }
  43. /**
  44. * Returns the keysize.
  45. *
  46. * @return the keysize.
  47. */
  48. public int getKeysize() {
  49. return keysize;
  50. }
  51. /**
  52. * Returns the public-exponent value.
  53. *
  54. * @return the public-exponent value.
  55. */
  56. public BigInteger getPublicExponent() {
  57. return publicExponent;
  58. }
  59. }