de.flexiprovider.core.mersa
Class MeRSAPrivateKey

java.lang.Object
  |
  +--de.flexiprovider.api.keys.PrivateKey
        |
        +--de.flexiprovider.core.rsa.interfaces.RSAPrivateKey
              |
              +--de.flexiprovider.core.rsa.interfaces.RSAPrivateCrtKey
                    |
                    +--de.flexiprovider.core.rsa.RSAPrivateCrtKey
                          |
                          +--de.flexiprovider.core.mersa.MeRSAPrivateKey
All Implemented Interfaces:
Key, java.security.Key, java.security.PrivateKey, RSAKey, java.security.interfaces.RSAKey, java.security.interfaces.RSAPrivateCrtKey, java.security.interfaces.RSAPrivateKey, java.io.Serializable

public class MeRSAPrivateKey
extends RSAPrivateCrtKey

This class implements the MeRSAPrivateKey interface.

Author:
Erik Dahmen, Paul Nguentcheu
See Also:
MeRSAKeyPairGenerator, Serialized Form

Fields inherited from class de.flexiprovider.core.rsa.RSAPrivateCrtKey
crtCoeff, d, dP, dQ, e, n, p, q
 
Fields inherited from interface java.security.PrivateKey
serialVersionUID
 
Constructor Summary
protected MeRSAPrivateKey(FlexiBigInt n, FlexiBigInt e, FlexiBigInt d, FlexiBigInt p, FlexiBigInt q, FlexiBigInt dP, FlexiBigInt dQ, FlexiBigInt crtCoeff, FlexiBigInt k, FlexiBigInt eInvP)
          Generate a new MeRSA private key.
protected MeRSAPrivateKey(MeRSAPrivateKeySpec keySpec)
          Construct an MeRSAPrivateKey out of the given key specification.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compare this key with another object.
protected  codec.asn1.ASN1Type getAlgParams()
           
 FlexiBigInt getEInvP()
           
 FlexiBigInt getK()
           
protected  byte[] getKeyData()
           
protected  codec.asn1.ASN1ObjectIdentifier getOID()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class de.flexiprovider.core.rsa.RSAPrivateCrtKey
getCRTCoeff, getD, getDp, getDq, getE, getN, getP, getQ
 
Methods inherited from class de.flexiprovider.core.rsa.interfaces.RSAPrivateCrtKey
getCrtCoefficient, getPrimeExponentP, getPrimeExponentQ, getPrimeP, getPrimeQ, getPublicExponent
 
Methods inherited from class de.flexiprovider.core.rsa.interfaces.RSAPrivateKey
getAlgorithm, getModulus, getPrivateExponent
 
Methods inherited from class de.flexiprovider.api.keys.PrivateKey
getEncoded, getFormat
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.interfaces.RSAPrivateKey
getPrivateExponent
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 
Methods inherited from interface java.security.interfaces.RSAKey
getModulus
 

Constructor Detail

MeRSAPrivateKey

protected MeRSAPrivateKey(FlexiBigInt n,
                          FlexiBigInt e,
                          FlexiBigInt d,
                          FlexiBigInt p,
                          FlexiBigInt q,
                          FlexiBigInt dP,
                          FlexiBigInt dQ,
                          FlexiBigInt crtCoeff,
                          FlexiBigInt k,
                          FlexiBigInt eInvP)
Generate a new MeRSA private key.
Parameters:
n - the number n = p*q;
e - the public exponent e.
d - the private exponent d.
p - the prime p.
q - the prime q.
dP - the number d mod (p-1).
dQ - the number d mod (q-1).
crtCoeff - the coefficient for MeRSA decryption with the CRT.
k - the exponent k.
eInvP - the inverse of the public exponent modulo p.
See Also:
MeRSAKeyPairGenerator

MeRSAPrivateKey

protected MeRSAPrivateKey(MeRSAPrivateKeySpec keySpec)
Construct an MeRSAPrivateKey out of the given key specification.
Parameters:
keySpec - the key specification
Method Detail

getK

public FlexiBigInt getK()
Returns:
the exponent k

getEInvP

public FlexiBigInt getEInvP()
Returns:
the inverse of the public exponent modulo p

equals

public boolean equals(java.lang.Object other)
Compare this key with another object.
Overrides:
equals in class RSAPrivateCrtKey
Parameters:
other - the other object
Returns:
the result of the comparison

toString

public java.lang.String toString()
Overrides:
toString in class RSAPrivateCrtKey
Returns:
a human readable form of the key

hashCode

public int hashCode()
Overrides:
hashCode in class RSAPrivateCrtKey

getOID

protected codec.asn1.ASN1ObjectIdentifier getOID()
Overrides:
getOID in class RSAPrivateCrtKey
Returns:
the OID to encode in the SubjectPublicKeyInfo structure

getAlgParams

protected codec.asn1.ASN1Type getAlgParams()
Overrides:
getAlgParams in class RSAPrivateCrtKey
Returns:
the algorithm parameters to encode in the SubjectPublicKeyInfo structure

getKeyData

protected byte[] getKeyData()
Overrides:
getKeyData in class RSAPrivateCrtKey
Returns:
the keyData to encode in the SubjectPublicKeyInfo structure