public class ElGamalPrivateKeyImpl extends Object implements ElGamalPrivateKey, DHPrivateKey
| Modifier | Constructor and Description |
|---|---|
protected | ElGamalPrivateKeyImpl()No-arg constructor. |
| ElGamalPrivateKeyImpl(BigInteger x,
ElGamalParameterSpec elSpec)Create from the private exponent and parameters. |
| ElGamalPrivateKeyImpl(DHPrivateKey key)Create from a DH private key. |
| ElGamalPrivateKeyImpl(DHPrivateKeySpec spec)Create from a DH private key spec. |
| ElGamalPrivateKeyImpl(ElGamalPrivateKey key)Create a copy of the given ElGamal private key. |
| ElGamalPrivateKeyImpl(ElGamalPrivateKeySpec spec)Create from an ElGamal private key spec. |
| ElGamalPrivateKeyImpl(PKCS8EncodedKeySpec spec)Constructor from PKCS8 key spec. |
| Modifier and Type | Method and Description |
|---|---|
String | getAlgorithm()The algorithm name, "ElGamal". |
byte[] | getEncoded()Return a PKCS8 representation of the key. |
String | getFormat()The encoding format produced by getEncoded(). |
ElGamalParameterSpec | getParameters()The ElGamal parameters for this key. |
DHParameterSpec | getParams()The parameters for this key. |
BigInteger | getX()The private exponent. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyedprotected ElGamalPrivateKeyImpl()
public ElGamalPrivateKeyImpl(BigInteger x, ElGamalParameterSpec elSpec)
x - The private exponent.elSpec - The ElGamal parameters.public ElGamalPrivateKeyImpl(DHPrivateKey key)
key - the DH private keypublic ElGamalPrivateKeyImpl(DHPrivateKeySpec spec)
spec - the DH private key specpublic ElGamalPrivateKeyImpl(ElGamalPrivateKey key)
key - the keypublic ElGamalPrivateKeyImpl(ElGamalPrivateKeySpec spec)
spec - the ElGamal private key specpublic ElGamalPrivateKeyImpl(PKCS8EncodedKeySpec spec) throws InvalidKeySpecException
spec - the PKCS8 key specInvalidKeySpecException - always, not yet implementedpublic String getAlgorithm()
getAlgorithm in interface Keypublic byte[] getEncoded()
getEncoded in interface Keypublic String getFormat()
public ElGamalParameterSpec getParameters()
getParameters in interface ElGamalKeypublic DHParameterSpec getParams()
public BigInteger getX()
getX in interface DHPrivateKeygetX in interface ElGamalPrivateKey