anon.crypto
Class MyECPublicKey

java.lang.Object
  extended by anon.crypto.AbstractPublicKey
      extended by anon.crypto.MyECPublicKey
All Implemented Interfaces:
IMyPublicKey, IXMLEncodable, java.io.Serializable, java.security.Key, java.security.PublicKey

public final class MyECPublicKey
extends AbstractPublicKey
implements IMyPublicKey

See Also:
Serialized Form

Field Summary
private  MyECParams m_params
           
private  org.bouncycastle.asn1.x9.X9ECPoint m_Q
           
 
Fields inherited from interface java.security.PublicKey
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
MyECPublicKey(org.bouncycastle.crypto.params.ECPublicKeyParameters params)
           
MyECPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo spki)
           
 
Method Summary
 boolean equals(java.lang.Object a_publicKey)
          This method returns if two public keys have the same public key parameters.
 java.lang.String getAlgorithm()
           
 org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getAsSubjectPublicKeyInfo()
          Gets the key as a SubjectPublicKeyInfo object.
 java.lang.String getFormat()
           
 int getKeyLength()
          Returns the length of the key.
 org.bouncycastle.crypto.params.ECPublicKeyParameters getPublicParams()
           
 ISignatureVerificationAlgorithm getSignatureAlgorithm()
          Gets a signature algorithm object for this key.
 int hashCode()
           
protected  void setNamedCurveID(org.bouncycastle.asn1.DERObjectIdentifier curveIdentifier)
           
 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.AbstractPublicKey
getEncoded
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Key
getEncoded
 

Field Detail

m_Q

private org.bouncycastle.asn1.x9.X9ECPoint m_Q

m_params

private MyECParams m_params
Constructor Detail

MyECPublicKey

public MyECPublicKey(org.bouncycastle.crypto.params.ECPublicKeyParameters params)

MyECPublicKey

public MyECPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo spki)
              throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException
Method Detail

equals

public boolean equals(java.lang.Object a_publicKey)
Description copied from class: AbstractPublicKey
This method returns if two public keys have the same public key parameters.

Specified by:
equals in interface IMyPublicKey
Specified by:
equals in class AbstractPublicKey
Parameters:
a_publicKey - an other public key
Returns:
true if the keys have the same public key parameters; false otherwise

hashCode

public int hashCode()
Specified by:
hashCode in interface IMyPublicKey
Specified by:
hashCode in class AbstractPublicKey
Returns:
the public key`s hash code
See Also:
Object.hashCode()

getAsSubjectPublicKeyInfo

public org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getAsSubjectPublicKeyInfo()
Description copied from interface: IMyPublicKey
Gets the key as a SubjectPublicKeyInfo object.

Specified by:
getAsSubjectPublicKeyInfo in interface IMyPublicKey
Returns:
the key as a SubjectPublicKeyInfo object

getKeyLength

public int getKeyLength()
Description copied from interface: IMyPublicKey
Returns the length of the key. The length of the key often corresponds with the security it provides.

Specified by:
getKeyLength in interface IMyPublicKey
Returns:
the length of the key

getSignatureAlgorithm

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

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

getPublicParams

public org.bouncycastle.crypto.params.ECPublicKeyParameters getPublicParams()

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
See Also:
4050

setNamedCurveID

protected void setNamedCurveID(org.bouncycastle.asn1.DERObjectIdentifier curveIdentifier)