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