KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > crypto > spec > DHParameterSpec


1 /*
2  * @(#)DHParameterSpec.java 1.5 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 /*
9  * NOTE:
10  * Because of various external restrictions (i.e. US export
11  * regulations, etc.), the actual source code can not be provided
12  * at this time. This file represents the skeleton of the source
13  * file, so that javadocs of the API can be created.
14  */

15
16 package javax.crypto.spec;
17
18 import java.math.BigInteger;
19 import java.security.spec.AlgorithmParameterSpec;
20
21 /**
22  * This class specifies the set of parameters used with the Diffie-Hellman
23  * algorithm, as specified in PKCS #3: <i>Diffie-Hellman Key-Agreement
24  * Standard</i>.
25  *
26  * <p>A central authority generates parameters and gives them to the two
27  * entities seeking to generate a secret key. The parameters are a prime
28  * <code>p</code>, a base <code>g</code>, and optionally the length
29  * in bits of the private value, <code>l</code>.
30  *
31  * <p>It is possible that more than one instance of parameters may be
32  * generated by a given central authority, and that there may be more than
33  * one central authority. Indeed, each individual may be its own central
34  * authority, with different entities having different parameters.
35  *
36  * <p>Note that this class does not perform any validation on specified
37  * parameters. Thus, the specified values are returned directly even
38  * if they are null.
39  *
40  * @author Jan Luehe
41  *
42  * @version 1.14, 10/29/03
43  *
44  * @see javax.crypto.KeyAgreement
45  * @since 1.4
46  */

47 public class DHParameterSpec implements AlgorithmParameterSpec
48 {
49
50     /**
51      * Constructs a parameter set for Diffie-Hellman, using a prime modulus
52      * <code>p</code> and a base generator <code>g</code>.
53      *
54      * @param p the prime modulus
55      * @param g the base generator
56      */

57     public DHParameterSpec(BigInteger p, BigInteger g) { }
58
59     /**
60      * Constructs a parameter set for Diffie-Hellman, using a prime modulus
61      * <code>p</code>, a base generator <code>g</code>,
62      * and the size in bits, <code>l</code>, of the random exponent
63      * (private value).
64      *
65      * @param p the prime modulus
66      * @param g the base generator
67      * @param l the size in bits of the random exponent (private value)
68      */

69     public DHParameterSpec(BigInteger p, BigInteger g, int l) { }
70
71     /**
72      * Returns the prime modulus <code>p</code>.
73      *
74      * @return the prime modulus <code>p</code>
75      */

76     public BigInteger getP() { }
77
78     /**
79      * Returns the base generator <code>g</code>.
80      *
81      * @return the base generator <code>g</code>
82      */

83     public BigInteger getG() { }
84
85     /**
86      * Returns the size in bits, <code>l</code>, of the random exponent
87      * (private value).
88      *
89      * @return the size in bits, <code>l</code>, of the random exponent
90      * (private value), or 0 if this size has not been set
91      */

92     public int getL() { }
93 }
94
Popular Tags