anon.crypto
Class MyECPrivateKey

java.lang.Object
  extended by anon.crypto.AbstractPrivateKey
      extended by anon.crypto.MyECPrivateKey
All Implemented Interfaces:
IMyPrivateKey, IXMLEncodable, java.io.Serializable, java.security.Key, java.security.PrivateKey

public final class MyECPrivateKey
extends AbstractPrivateKey
implements IMyPrivateKey

See Also:
Serialized Form

Field Summary
private  java.math.BigInteger m_D
           
private  MyECParams m_params
           
 
Fields inherited from interface java.security.PrivateKey
serialVersionUID
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_LANGUAGE, XML_ATTR_VERSION
 
Constructor Summary
MyECPrivateKey(org.bouncycastle.crypto.params.ECPrivateKeyParameters params, org.bouncycastle.asn1.DERObjectIdentifier curveId)
           
MyECPrivateKey(org.w3c.dom.Element a_xmlElement)
           
MyECPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privKeyInfo)
          Use ECPrivateKeyStructure defined in "SEC 1: Elliptic Curve Cryptography" to be compatible with OpenSSL
 
Method Summary
 IMyPublicKey createPublicKey()
          Creates the corresponding public key to this private key.
 java.lang.String getAlgorithm()
           
 org.bouncycastle.asn1.pkcs.PrivateKeyInfo getAsPrivateKeyInfo()
          Use ECPrivateKeyStructure defined in "SEC 1: Elliptic Curve Cryptography" section to be compatible with OpenSSL
 java.lang.String getFormat()
           
 org.bouncycastle.crypto.params.ECPrivateKeyParameters getPrivateParams()
           
 ISignatureCreationAlgorithm getSignatureAlgorithm()
          Gets a signature algorithm object for this key.
 org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
          Return an element that can be appended to the document.
 
Methods inherited from class anon.crypto.AbstractPrivateKey
getEncoded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Key
getEncoded
 

Field Detail

m_D

private java.math.BigInteger m_D

m_params

private MyECParams m_params
Constructor Detail

MyECPrivateKey

public MyECPrivateKey(org.bouncycastle.crypto.params.ECPrivateKeyParameters params,
                      org.bouncycastle.asn1.DERObjectIdentifier curveId)

MyECPrivateKey

public MyECPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privKeyInfo)
               throws java.security.InvalidKeyException
Use ECPrivateKeyStructure defined in "SEC 1: Elliptic Curve Cryptography" to be compatible with OpenSSL

Parameters:
privKeyInfo -
Throws:
java.security.InvalidKeyException
See Also:
http://www.secg.org/

MyECPrivateKey

public MyECPrivateKey(org.w3c.dom.Element a_xmlElement)
               throws java.security.InvalidKeyException,
                      XMLParseException
Throws:
java.security.InvalidKeyException
XMLParseException
See Also:
4050
Method Detail

createPublicKey

public IMyPublicKey createPublicKey()
Description copied from interface: IMyPrivateKey
Creates the corresponding public key to this private key.

Specified by:
createPublicKey in interface IMyPrivateKey
Returns:
the corresponding public key to this private key
See Also:
ECKeyPairGenerator

getAsPrivateKeyInfo

public org.bouncycastle.asn1.pkcs.PrivateKeyInfo getAsPrivateKeyInfo()
Use ECPrivateKeyStructure defined in "SEC 1: Elliptic Curve Cryptography" section to be compatible with OpenSSL

Specified by:
getAsPrivateKeyInfo in interface IMyPrivateKey
Returns:
See Also:
http://www.secg.org/

getSignatureAlgorithm

public ISignatureCreationAlgorithm getSignatureAlgorithm()
Gets a signature algorithm object for this key.

Specified by:
getSignatureAlgorithm in interface IMyPrivateKey
Returns:
a signature algorithm object for this key

getAlgorithm

public java.lang.String getAlgorithm()
Specified by:
getAlgorithm in interface java.security.Key

getFormat

public java.lang.String getFormat()
Specified by:
getFormat in interface java.security.Key

toXmlElement

public org.w3c.dom.Element toXmlElement(org.w3c.dom.Document a_doc)
Description copied from interface: IXMLEncodable
Return an element that can be appended to the document. This Method must not change the document in any way!

Specified by:
toXmlElement in interface IXMLEncodable
Parameters:
a_doc - a document
Returns:
the interface as xml element

getPrivateParams

public org.bouncycastle.crypto.params.ECPrivateKeyParameters getPrivateParams()