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

boolean
equals(Object o)
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()
return a parameter specification representing the EC domain parameters for the key.
ECParameterSpec
getParams()
Deprecated. this method vanises in JDK 1.5.
int
hashCode()
void
setBagAttribute(DERObjectIdentifier oid, DEREncodable attribute)
void
setPointFormat(String style)
Set the formatting for encoding of points.

Constructor Details

JCEECPrivateKey

protected JCEECPrivateKey()

Method Details

equals

public boolean equals(Object o)

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()
return a parameter specification representing the EC domain parameters for the key.
Specified by:
getParameters in interface ECKey

getParams

public ECParameterSpec getParams()

Deprecated. this method vanises in JDK 1.5. Use getParameters().

return a parameter specification representing the EC domain parameters for the key.
Specified by:
getParams in interface ECKey

hashCode

public int hashCode()

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. If the String "COMPRESSED" is passed point compression will be used. The default is "UNCOMPRESSED".
Specified by:
setPointFormat in interface ECPointEncoder
Parameters:
style - the style to use.