01: package org.bouncycastle.crypto.params;
02:
03: import java.math.BigInteger;
04:
05: public class ElGamalPrivateKeyParameters extends ElGamalKeyParameters {
06: private BigInteger x;
07:
08: public ElGamalPrivateKeyParameters(BigInteger x,
09: ElGamalParameters params) {
10: super (true, params);
11:
12: this .x = x;
13: }
14:
15: public BigInteger getX() {
16: return x;
17: }
18:
19: public boolean equals(Object obj) {
20: if (!(obj instanceof ElGamalPrivateKeyParameters)) {
21: return false;
22: }
23:
24: ElGamalPrivateKeyParameters pKey = (ElGamalPrivateKeyParameters) obj;
25:
26: if (!pKey.getX().equals(x)) {
27: return false;
28: }
29:
30: return super .equals(obj);
31: }
32:
33: public int hashCode() {
34: return getX().hashCode();
35: }
36: }
|