anon.crypto
Class MyDSAPublicKey

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

public final class MyDSAPublicKey
extends AbstractPublicKey
implements java.security.interfaces.DSAPublicKey, IMyPublicKey

See Also:
Serialized Form

Field Summary
private  long m_hashValue
           
private  MyDSAParams m_params
           
private  java.math.BigInteger m_Y
           
 
Fields inherited from interface java.security.interfaces.DSAPublicKey
serialVersionUID
 
Fields inherited from interface anon.util.IXMLEncodable
FIELD_XML_ELEMENT_CONTAINER_NAME, FIELD_XML_ELEMENT_NAME, XML_ATTR_ID, XML_ATTR_VERSION
 
Constructor Summary
MyDSAPublicKey(org.bouncycastle.crypto.params.DSAPublicKeyParameters params)
           
MyDSAPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo info)
           
 
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.
 MyDSAParams getMyDASParams()
           
 java.security.interfaces.DSAParams getParams()
           
 org.bouncycastle.crypto.params.DSAPublicKeyParameters getPublicParams()
           
 ISignatureVerificationAlgorithm getSignatureAlgorithm()
          Gets a signature algorithm object for this key.
 java.math.BigInteger getY()
           
 int hashCode()
           
 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
 
Methods inherited from interface java.security.Key
getEncoded
 

Field Detail

m_Y

private java.math.BigInteger m_Y

m_params

private MyDSAParams m_params

m_hashValue

private long m_hashValue
Constructor Detail

MyDSAPublicKey

public MyDSAPublicKey(org.bouncycastle.crypto.params.DSAPublicKeyParameters params)

MyDSAPublicKey

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

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

getY

public java.math.BigInteger getY()
Specified by:
getY in interface java.security.interfaces.DSAPublicKey

getParams

public java.security.interfaces.DSAParams getParams()
Specified by:
getParams in interface java.security.interfaces.DSAKey

getPublicParams

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

getMyDASParams

public MyDSAParams getMyDASParams()

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

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

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

equals

public boolean equals(java.lang.Object a_publicKey)
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()

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