anon.crypto
Interface IMyPublicKey

All Superinterfaces:
IXMLEncodable, java.security.Key, java.security.PublicKey, java.io.Serializable
All Known Implementing Classes:
AbstractPublicKey, MyDSAPublicKey, MyRSAPublicKey

public interface IMyPublicKey
extends java.security.PublicKey, IXMLEncodable

Represents the public part of an asymmetric cryptographic key pair.


Field Summary
 
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_VERSION
 
Method Summary
 boolean equals(java.lang.Object a_object)
          This method returns if two public keys have the same public key parameters.
 org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getAsSubjectPublicKeyInfo()
          Gets the key as a SubjectPublicKeyInfo object.
 int getKeyLength()
          Returns the length of the key.
 ISignatureVerificationAlgorithm getSignatureAlgorithm()
          Gets the signature algorithm object that is held and initialised with this key.
 int hashCode()
           
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 
Methods inherited from interface anon.util.IXMLEncodable
toXmlElement
 

Method Detail

getSignatureAlgorithm

ISignatureVerificationAlgorithm getSignatureAlgorithm()
Gets the signature algorithm object that is held and initialised with this key. It is ready to verify messages and does not need to be reinitialised by the caller. Therefore, this method must make sure that the algorithm is initialised with this key.

Returns:
the signature algorithm object that is held and initialised by this key

getAsSubjectPublicKeyInfo

org.bouncycastle.asn1.x509.SubjectPublicKeyInfo getAsSubjectPublicKeyInfo()
Gets the key as a SubjectPublicKeyInfo object.

Returns:
the key as a SubjectPublicKeyInfo object

getKeyLength

int getKeyLength()
Returns the length of the key. The length of the key often corresponds with the security it provides.

Returns:
the length of the key

equals

boolean equals(java.lang.Object a_object)
This method returns if two public keys have the same public key parameters.

Overrides:
equals in class java.lang.Object
Parameters:
a_object - an other public key
Returns:
true if the keys have the same public key parameters; false otherwise

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
the public key`s hash code
See Also:
Object.hashCode()