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