org.bouncycastle.jce.provider

Class JCEElGamalPrivateKey

Implemented Interfaces:
DHPrivateKey, ElGamalKey, ElGamalPrivateKey, PrivateKey, PKCS12BagAttributeCarrier

public class JCEElGamalPrivateKey
extends java.lang.Object
implements ElGamalPrivateKey, DHPrivateKey, PKCS12BagAttributeCarrier

Constructor Summary

JCEElGamalPrivateKey()

Method Summary

String
getAlgorithm()
DEREncodable
getBagAttribute(DERObjectIdentifier oid)
Enumeration
getBagAttributeKeys()
byte[]
getEncoded()
Return a PKCS8 representation of the key.
String
getFormat()
return the encoding format we produce in getEncoded().
ElGamalParameterSpec
getParameters()
DHParameterSpec
getParams()
BigInteger
getX()
void
setBagAttribute(DERObjectIdentifier oid, DEREncodable attribute)

Constructor Details

JCEElGamalPrivateKey

protected JCEElGamalPrivateKey()

Method Details

getAlgorithm

public String getAlgorithm()

getBagAttribute

public DEREncodable getBagAttribute(DERObjectIdentifier oid)
Specified by:
getBagAttribute in interface PKCS12BagAttributeCarrier

getBagAttributeKeys

public Enumeration getBagAttributeKeys()
Specified by:
getBagAttributeKeys in interface PKCS12BagAttributeCarrier

getEncoded

public byte[] getEncoded()
Return a PKCS8 representation of the key. The sequence returned represents a full PrivateKeyInfo object.
Returns:
a PKCS8 representation of the key.

getFormat

public String getFormat()
return the encoding format we produce in getEncoded().
Returns:
the string "PKCS#8"

getParameters

public ElGamalParameterSpec getParameters()
Specified by:
getParameters in interface ElGamalKey

getParams

public DHParameterSpec getParams()

getX

public BigInteger getX()
Specified by:
getX in interface ElGamalPrivateKey

setBagAttribute

public void setBagAttribute(DERObjectIdentifier oid,
                            DEREncodable attribute)
Specified by:
setBagAttribute in interface PKCS12BagAttributeCarrier