Logo Search packages:      
Sourcecode: bouncycastle version File versions

DHPrivateKeySpec.java

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
 */
00011 public class DHPrivateKeySpec
    implements KeySpec
{
    private BigInteger  x;
    private BigInteger  p;
    private BigInteger  g;

    /**
     * Constructor that takes a private value <code>x</code>, a prime
     * modulus <code>p</code>, and a base generator <code>g</code>.
     */
00022     public DHPrivateKeySpec(
        BigInteger  x,
        BigInteger  p,
        BigInteger  g)
    {
        this.x = x;
        this.p = p;
        this.g = g;
    }

    /**
     * Returns the private value <code>x</code>.
     *
     * @return the private value <code>x</code>
     */
00037     public BigInteger getX()
    {
        return x;
    }

    /**
     * Returns the prime modulus <code>p</code>.
     *
     * @return the prime modulus <code>p</code>
     */
00047     public BigInteger getP()
    {
        return p;
    }

    /**
     * Returns the base generator <code>g</code>.
     * 
     * @return the base generator <code>g</code>
     */
00057     public BigInteger getG()
    {
        return g;
    }
}

Generated by  Doxygen 1.6.0   Back to index