anon.crypto
Class AbstractPrivateKey

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

public abstract class AbstractPrivateKey
extends java.lang.Object
implements IMyPrivateKey

This class is an abstract implementation of a private key.

Author:
Rolf Wendolsky
See Also:
Serialized Form

Field Summary
 
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
protected AbstractPrivateKey()
          Creates a new (empty) private key;
  AbstractPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo a_keyInfo)
          Creates a private key from a PrivateKeyInfo.
 
Method Summary
 byte[] getEncoded()
          Returns the key in a byte encoded form that is defined be the result of the method getAsPrivateKeyInfo() .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface anon.crypto.IMyPrivateKey
createPublicKey, getAsPrivateKeyInfo, getSignatureAlgorithm
 
Methods inherited from interface java.security.Key
getAlgorithm, getFormat
 
Methods inherited from interface anon.util.IXMLEncodable
toXmlElement
 

Constructor Detail

AbstractPrivateKey

protected AbstractPrivateKey()
Creates a new (empty) private key;


AbstractPrivateKey

public AbstractPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo a_keyInfo)
Creates a private key from a PrivateKeyInfo. Every private key class should implement this constructor.

Parameters:
a_keyInfo - a PrivateKeyInfo
Method Detail

getEncoded

public final byte[] getEncoded()
Returns the key in a byte encoded form that is defined be the result of the method getAsPrivateKeyInfo() .

Specified by:
getEncoded in interface java.security.Key
Returns:
the key in a byte encoded form
See Also:
IMyPrivateKey.getAsPrivateKeyInfo()