org.bouncycastle.jce.provider

Class JCEECPrivateKey

Implemented Interfaces:
ECKey, ECPointEncoder, ECPrivateKey, PrivateKey, PKCS12BagAttributeCarrier

public class JCEECPrivateKey
extends java.lang.Object
implements ECPrivateKey, PKCS12BagAttributeCarrier, ECPointEncoder

Constructor Summary

JCEECPrivateKey()

Method Summary

String
getAlgorithm()
DEREncodable
getBagAttribute(DERObjectIdentifier oid)
Enumeration
getBagAttributeKeys()
BigInteger
getD()
return the private value D.
byte[]
getEncoded()
Return a PKCS8 representation of the key.
String
getFormat()
return the encoding format we produce in getEncoded().
ECParameterSpec
getParameters()
ECParameterSpec
getParams()
void
setBagAttribute(DERObjectIdentifier oid, DEREncodable attribute)
void
setPointFormat(String style)
Set the formatting for encoding of points.

Constructor Details

JCEECPrivateKey

protected JCEECPrivateKey()

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


getD

public BigInteger getD()
return the private value D.
Specified by:
getD in interface ECPrivateKey


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 ECParameterSpec getParameters()
Specified by:
getParameters in interface ECKey


getParams

public ECParameterSpec getParams()
Specified by:
getParams in interface ECKey


setBagAttribute

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


setPointFormat

public void setPointFormat(String style)
Set the formatting for encoding of points. If the String "UNCOMPRESSED" is passed in point compression will not be used. The default is "COMPRESSED".
Specified by:
setPointFormat in interface ECPointEncoder

Parameters:
style - the style to use.