KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > security > spec > RSAKeyGenParameterSpec


1 /*
2  * @(#)RSAKeyGenParameterSpec.java 1.8 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.security.spec;
9
10 import java.math.BigInteger JavaDoc;
11 import java.security.spec.AlgorithmParameterSpec JavaDoc;
12
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.8 12/19/03
19  *
20  * @see java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
21  *
22  * @since 1.3
23  */

24
25 public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec JavaDoc {
26
27     private int keysize;
28     private BigInteger JavaDoc publicExponent;
29
30     /**
31      * The public-exponent value F0 = 3.
32      */

33     public static final BigInteger JavaDoc F0 = BigInteger.valueOf(3);
34
35     /**
36      * The public exponent-value F4 = 65537.
37      */

38     public static final BigInteger JavaDoc F4 = BigInteger.valueOf(65537);
39
40     /**
41      * Constructs a new <code>RSAParameterSpec</code> object from the
42      * given keysize and public-exponent value.
43      *
44      * @param keysize the modulus size (specified in number of bits)
45      * @param publicExponent the public exponent
46      */

47     public RSAKeyGenParameterSpec(int keysize, BigInteger JavaDoc publicExponent) {
48     this.keysize = keysize;
49     this.publicExponent = publicExponent;
50     }
51
52     /**
53      * Returns the keysize.
54      *
55      * @return the keysize.
56      */

57     public int getKeysize() {
58     return keysize;
59     }
60
61     /**
62      * Returns the public-exponent value.
63      *
64      * @return the public-exponent value.
65      */

66     public BigInteger JavaDoc getPublicExponent() {
67     return publicExponent;
68     }
69 }
70
Popular Tags