package javax.crypto.spec; import java.math.BigInteger; import java.security.spec.KeySpec; /** * This class specifies a Diffie-Hellman public key with its associated parameters. * * @see DHPrivateKeySpec */ public class DHPublicKeySpec implements KeySpec { private BigInteger y; private BigInteger p; private BigInteger g; /** * Constructor that takes a public value y, a prime * modulus p, and a base generator g. */ public DHPublicKeySpec( BigInteger y, BigInteger p, BigInteger g) { this.y = y; this.p = p; this.g = g; } /** * Returns the public value y. * * @return the public value y */ public BigInteger getY() { return y; } /** * Returns the prime modulus p. * * @return the prime modulus p */ public BigInteger getP() { return p; } /** * Returns the base generator g. * * @return the base generator g */ public BigInteger getG() { return g; } }