anon.crypto
Class MyRSAPrivateKey

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

public final class MyRSAPrivateKey
extends AbstractPrivateKey
implements IMyPrivateKey

See Also:
Serialized Form

Field Summary
private  MyRSASignature m_algorithm
           
private  org.bouncycastle.crypto.params.RSAPrivateCrtKeyParameters m_Params
           
static java.lang.String XML_ELEMENT_NAME
           
 
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
MyRSAPrivateKey(java.math.BigInteger modulus, java.math.BigInteger publicExponent, java.math.BigInteger privateExponent, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger dP, java.math.BigInteger dQ, java.math.BigInteger qInv)
           
MyRSAPrivateKey(org.bouncycastle.crypto.CipherParameters cipherparams)
           
MyRSAPrivateKey(org.w3c.dom.Element a_xmlElement)
           
MyRSAPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privKeyInfo)
           
 
Method Summary
 IMyPublicKey createPublicKey()
          Creates the corresponding public key to this private key.
 java.lang.String getAlgorithm()
           
 org.bouncycastle.asn1.pkcs.PrivateKeyInfo getAsPrivateKeyInfo()
          Gets the private key as a PrivateKeyInfo object.
 java.math.BigInteger getDP()
           
 java.math.BigInteger getDQ()
           
 java.lang.String getFormat()
           
 java.math.BigInteger getModulus()
           
 java.math.BigInteger getP()
           
 org.bouncycastle.crypto.CipherParameters getParams()
           
 java.math.BigInteger getPrivateExponent()
           
 java.math.BigInteger getPublicExponent()
           
 java.math.BigInteger getQ()
           
 java.math.BigInteger getQInv()
           
 ISignatureCreationAlgorithm getSignatureAlgorithm()
          Gets a signature algorithm object for this key.
 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.AbstractPrivateKey
getEncoded
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Key
getEncoded
 

Field Detail

XML_ELEMENT_NAME

public static final java.lang.String XML_ELEMENT_NAME
See Also:
Constant Field Values

m_algorithm

private MyRSASignature m_algorithm

m_Params

private org.bouncycastle.crypto.params.RSAPrivateCrtKeyParameters m_Params
Constructor Detail

MyRSAPrivateKey

public MyRSAPrivateKey(org.bouncycastle.crypto.CipherParameters cipherparams)
                throws java.lang.Exception
Throws:
java.lang.Exception

MyRSAPrivateKey

public MyRSAPrivateKey(org.bouncycastle.asn1.pkcs.PrivateKeyInfo privKeyInfo)
                throws java.lang.Exception
Throws:
java.lang.Exception

MyRSAPrivateKey

public MyRSAPrivateKey(org.w3c.dom.Element a_xmlElement)
                throws java.lang.Exception
Throws:
java.lang.Exception

MyRSAPrivateKey

public MyRSAPrivateKey(java.math.BigInteger modulus,
                       java.math.BigInteger publicExponent,
                       java.math.BigInteger privateExponent,
                       java.math.BigInteger p,
                       java.math.BigInteger q,
                       java.math.BigInteger dP,
                       java.math.BigInteger dQ,
                       java.math.BigInteger qInv)
                throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getSignatureAlgorithm

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

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

createPublicKey

public IMyPublicKey createPublicKey()
Creates the corresponding public key to this private key.

Specified by:
createPublicKey in interface IMyPrivateKey
Returns:
the corresponding public key to this private key

getParams

public org.bouncycastle.crypto.CipherParameters getParams()

getModulus

public java.math.BigInteger getModulus()

getPrivateExponent

public java.math.BigInteger getPrivateExponent()

getP

public java.math.BigInteger getP()

getQ

public java.math.BigInteger getQ()

getDP

public java.math.BigInteger getDP()

getDQ

public java.math.BigInteger getDQ()

getQInv

public java.math.BigInteger getQInv()

getPublicExponent

public java.math.BigInteger getPublicExponent()

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

getAsPrivateKeyInfo

public org.bouncycastle.asn1.pkcs.PrivateKeyInfo getAsPrivateKeyInfo()
Description copied from interface: IMyPrivateKey
Gets the private key as a PrivateKeyInfo object.

Specified by:
getAsPrivateKeyInfo in interface IMyPrivateKey
Returns:
the private key as a PrivateKeyInfo 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