51 static final long serialVersionUID = 7647557958927458271L;
52
53 // the public key
54 private BigInteger y;
55
56 // the key bytes, without the algorithm information
57 private byte[] key;
58
59 // the encoded key
60 private byte[] encodedKey;
61
62 // the prime modulus
63 private BigInteger p;
64
65 // the base generator
66 private BigInteger g;
67
68 // the private-value length (optional)
69 private int l;
70
71 private int DH_data[] = { 1, 2, 840, 113549, 1, 3, 1 };
72
73 /**
74 * Make a DH public key out of a public value <code>y</code>, a prime
75 * modulus <code>p</code>, and a base generator <code>g</code>.
76 *
77 * @param y the public value
78 * @param p the prime modulus
79 * @param g the base generator
80 *
81 * @exception InvalidKeyException if the key cannot be encoded
82 */
83 DHPublicKey(BigInteger y, BigInteger p, BigInteger g)
84 throws InvalidKeyException {
85 this(y, p, g, 0);
86 }
87
88 /**
89 * Make a DH public key out of a public value <code>y</code>, a prime
90 * modulus <code>p</code>, a base generator <code>g</code>, and a
91 * private-value length <code>l</code>.
|
51 static final long serialVersionUID = 7647557958927458271L;
52
53 // the public key
54 private BigInteger y;
55
56 // the key bytes, without the algorithm information
57 private byte[] key;
58
59 // the encoded key
60 private byte[] encodedKey;
61
62 // the prime modulus
63 private BigInteger p;
64
65 // the base generator
66 private BigInteger g;
67
68 // the private-value length (optional)
69 private int l;
70
71 private int[] DH_data = { 1, 2, 840, 113549, 1, 3, 1 };
72
73 /**
74 * Make a DH public key out of a public value <code>y</code>, a prime
75 * modulus <code>p</code>, and a base generator <code>g</code>.
76 *
77 * @param y the public value
78 * @param p the prime modulus
79 * @param g the base generator
80 *
81 * @exception InvalidKeyException if the key cannot be encoded
82 */
83 DHPublicKey(BigInteger y, BigInteger p, BigInteger g)
84 throws InvalidKeyException {
85 this(y, p, g, 0);
86 }
87
88 /**
89 * Make a DH public key out of a public value <code>y</code>, a prime
90 * modulus <code>p</code>, a base generator <code>g</code>, and a
91 * private-value length <code>l</code>.
|