de.flexiprovider.core.mprsa
Class MpRSAPrivateKey

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.mprsa.MpRSAPrivateKey
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 MpRSAPrivateKey
extends RSAPrivateCrtKey

This class implements a multi-prime RSA private key.

Author:
Paul Nguentcheu
See Also:
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
  MpRSAPrivateKey(FlexiBigInt n, FlexiBigInt e, FlexiBigInt d, FlexiBigInt p, FlexiBigInt q, FlexiBigInt dP, FlexiBigInt dQ, FlexiBigInt crtCoeff, RSAOtherPrimeInfo[] otherPrimeInfo)
          Generates a new MpRSA private key.
protected MpRSAPrivateKey(MpRSAPrivateKeySpec keySpec)
          Construct an MpRSAPrivateKey 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()
           
protected  byte[] getKeyData()
           
protected  codec.asn1.ASN1ObjectIdentifier getOID()
           
 RSAOtherPrimeInfo[] getOtherPrimeInfo()
           
 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

MpRSAPrivateKey

public MpRSAPrivateKey(FlexiBigInt n,
                       FlexiBigInt e,
                       FlexiBigInt d,
                       FlexiBigInt p,
                       FlexiBigInt q,
                       FlexiBigInt dP,
                       FlexiBigInt dQ,
                       FlexiBigInt crtCoeff,
                       RSAOtherPrimeInfo[] otherPrimeInfo)
Generates a new MpRSA 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 RSA decryption with the CRT.
otherPrimeInfo - the additional primes.
See Also:
MpRSAKeyPairGenerator

MpRSAPrivateKey

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

getOtherPrimeInfo

public RSAOtherPrimeInfo[] getOtherPrimeInfo()
Returns:
the additional primes

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