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