1 package org.bouncycastle.crypto.params; 2 3 import java.math.BigInteger; 4 5 public class DHPublicKeyParameters 6 extends DHKeyParameters 7 { 8 private BigInteger y; 9 10 public DHPublicKeyParameters( 11 BigInteger y, 12 DHParameters params) 13 { 14 super(false, params); 15 16 this.y = y; 17 } 18 19 public BigInteger getY() 20 { 21 return y; 22 } 23 24 public int hashCode() 25 { 26 return y.hashCode() ^ super.hashCode(); 27 } 28 29 public boolean equals( 30 Object obj) 31 { 32 if (!(obj instanceof DHPublicKeyParameters)) 33 { 34 return false; 35 } 36 37 DHPublicKeyParameters other = (DHPublicKeyParameters)obj; 38 39 return other.getY().equals(y) && super.equals(obj); 40 } 41 } 42