gnu.crypto.key.dh
public class GnuDHPrivateKey extends GnuDHKey implements DHPrivateKey
An implementation of the Diffie-Hellman private key.
Reference:
Version: $Revision: 1.2 $
Constructor Summary | |
---|---|
GnuDHPrivateKey(BigInteger q, BigInteger p, BigInteger g, BigInteger x) |
Method Summary | |
---|---|
byte[] | getEncoded() |
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 |
Deprecated: see getEncoded(int).
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.
Throws: IllegalArgumentException if the format is not supported.
See Also: DHKeyPairRawCodec
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.
Throws: ArrayIndexOutOfBoundsException if there is not enough bytes,
in k
, to represent a valid encoding of an instance of
this object. IllegalArgumentException if the byte sequence does not
represent a valid encoding of an instance of this object.