gnu.crypto.key.dh

Class GnuDHPrivateKey

Implemented Interfaces:
DHKey, DHPrivateKey, Key

public class GnuDHPrivateKey
extends GnuDHKey
implements DHPrivateKey

An implementation of the Diffie-Hellman private key.

Reference:

  1. Diffie-Hellman Key Agreement Method
    Eric Rescorla.
Version:
$Revision: 1.2 $

Field Summary

Fields inherited from class gnu.crypto.key.dh.GnuDHKey

g, p, q

Constructor Summary

GnuDHPrivateKey(BigInteger q, BigInteger p, BigInteger g, BigInteger x)

Method Summary

byte[]
getEncoded()
Deprecated. see getEncoded(int).
byte[]
getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
BigInteger
getX()
static GnuDHPrivateKey
valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey() method of a DH keypair codec object (an instance implementing IKeyPairCodec for DH keys, and re-constructs an instance of this object.

Methods inherited from class gnu.crypto.key.dh.GnuDHKey

equals, getAlgorithm, getFormat, getParams, getQ

Constructor Details

GnuDHPrivateKey

public GnuDHPrivateKey(BigInteger q,
                       BigInteger p,
                       BigInteger g,
                       BigInteger x)

Method Details

getEncoded

public byte[] getEncoded()

Deprecated. see getEncoded(int).


getEncoded

public byte[] getEncoded(int format)
Returns the encoded form of this private key according to the designated format.
Parameters:
format - the desired format identifier of the resulting encoding.
Returns:
the byte sequence encoding this key according to the designated format.

getX

public BigInteger getX()

valueOf

public static GnuDHPrivateKey valueOf(byte[] k)
A class method that takes the output of the encodePrivateKey() method of a DH keypair codec object (an instance implementing IKeyPairCodec for DH keys, and re-constructs an instance of this object.
Parameters:
k - the contents of a previously encoded instance of this object.

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.