01: package org.bouncycastle.crypto.params;
02:
03: public class ElGamalKeyParameters extends AsymmetricKeyParameter {
04: private ElGamalParameters params;
05:
06: protected ElGamalKeyParameters(boolean isPrivate,
07: ElGamalParameters params) {
08: super (isPrivate);
09:
10: this .params = params;
11: }
12:
13: public ElGamalParameters getParameters() {
14: return params;
15: }
16:
17: public int hashCode() {
18: return (params != null) ? params.hashCode() : 0;
19: }
20:
21: public boolean equals(Object obj) {
22: if (!(obj instanceof ElGamalKeyParameters)) {
23: return false;
24: }
25:
26: ElGamalKeyParameters dhKey = (ElGamalKeyParameters) obj;
27:
28: if (params == null) {
29: return dhKey.getParameters() == null;
30: } else {
31: return params.equals(dhKey.getParameters());
32: }
33: }
34: }
|