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