1. /*
  2. * @(#)RSAKeyGenParameterSpec.java 1.5 00/02/02
  3. *
  4. * Copyright 1999, 2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.security.spec;
  11. import java.math.BigInteger;
  12. import java.security.spec.AlgorithmParameterSpec;
  13. /**
  14. * This class specifies the set of parameters used to generate an RSA
  15. * key pair.
  16. *
  17. * @author Jan Luehe
  18. * @version 1.5 02/02/00
  19. *
  20. * @see java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
  21. *
  22. * @since 1.3
  23. */
  24. public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec {
  25. private int keysize;
  26. private BigInteger publicExponent;
  27. /**
  28. * The public-exponent value F0 = 3.
  29. */
  30. public static final BigInteger F0 = BigInteger.valueOf(3);
  31. /**
  32. * The public exponent-value F4 = 65537.
  33. */
  34. public static final BigInteger F4 = BigInteger.valueOf(65537);
  35. /**
  36. * Constructs a new <code>RSAParameterSpec</code> object from the
  37. * given keysize and public-exponent value.
  38. *
  39. * @param keysize the modulus size (specified in number of bits)
  40. * @param publicExponent the public exponent
  41. */
  42. public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent) {
  43. this.keysize = keysize;
  44. this.publicExponent = publicExponent;
  45. }
  46. /**
  47. * Returns the keysize.
  48. *
  49. * @return the keysize.
  50. */
  51. public int getKeysize() {
  52. return keysize;
  53. }
  54. /**
  55. * Returns the public-exponent value.
  56. *
  57. * @return the public-exponent value.
  58. */
  59. public BigInteger getPublicExponent() {
  60. return publicExponent;
  61. }
  62. }