anon.crypto
Class AbstractPublicKey
java.lang.Object
anon.crypto.AbstractPublicKey
- All Implemented Interfaces:
- IMyPublicKey, IXMLEncodable, java.io.Serializable, java.security.Key, java.security.PublicKey
- Direct Known Subclasses:
- MyDSAPublicKey, MyECPublicKey, MyRSAPublicKey
public abstract class AbstractPublicKey
- extends java.lang.Object
- implements IMyPublicKey
This class is an abstract implementation of a private key.
- Author:
- Rolf Wendolsky
- See Also:
- Serialized Form
Fields inherited from interface java.security.PublicKey |
serialVersionUID |
Constructor Summary |
protected |
AbstractPublicKey()
|
|
AbstractPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo a_keyInfo)
Creates a public key from a PrivateKeyInfo. |
Method Summary |
abstract boolean |
equals(java.lang.Object a_publicKey)
This method returns if two public keys have the same public key parameters. |
byte[] |
getEncoded()
Returns the key in a byte encoded form that is defined to be the result of the method
getAsSubjectPublicKeyInfo() . |
abstract int |
hashCode()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.security.Key |
getAlgorithm, getFormat |
AbstractPublicKey
protected AbstractPublicKey()
AbstractPublicKey
public AbstractPublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo a_keyInfo)
- Creates a public key from a PrivateKeyInfo. Every public key class should implement
this constructor.
- Parameters:
a_keyInfo
- a SubjectPublicKeyInfo
getEncoded
public final byte[] getEncoded()
- Returns the key in a byte encoded form that is defined to be the result of the method
getAsSubjectPublicKeyInfo()
.
- Specified by:
getEncoded
in interface java.security.Key
- Returns:
- the key in a byte encoded form
- See Also:
IMyPublicKey.getAsSubjectPublicKeyInfo()
hashCode
public abstract int hashCode()
- Specified by:
hashCode
in interface IMyPublicKey
- Overrides:
hashCode
in class java.lang.Object
- Returns:
- the public key`s hash code
- See Also:
Object.hashCode()
equals
public abstract 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
- Overrides:
equals
in class java.lang.Object
- Parameters:
a_publicKey
- an other public key
- Returns:
- true if the keys have the same public key parameters; false otherwise