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 interface java.security.PrivateKey |
serialVersionUID |
| 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 |
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
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