Class AsymmetricRSAPrivateKey
java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
org.bouncycastle.crypto.asymmetric.AsymmetricRSAPrivateKey
- All Implemented Interfaces:
Destroyable,AsymmetricKey,AsymmetricPrivateKey,Key
Class for RSA private keys.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
AsymmetricRSAKey.Usage -
Field Summary
Fields inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
DEF_ALG_ID, PSS_ALG_ID, rsaAlgIdentifier -
Constructor Summary
ConstructorsConstructorDescriptionAsymmetricRSAPrivateKey(Algorithm algorithm, byte[] privateKeyInfoEncoding) AsymmetricRSAPrivateKey(Algorithm algorithm, BigInteger modulus, BigInteger privateExponent) AsymmetricRSAPrivateKey(Algorithm algorithm, BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger p, BigInteger q, BigInteger dp, BigInteger dq, BigInteger qInv) AsymmetricRSAPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo) -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()booleanReturn true if o is an equivalent key to this.Return the algorithm this RSA key is for.getDP()getDQ()byte[]Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.Return the modulus for this RSA key.getP()getQ()getQInv()inthashCode()Return the hashCode for the key.booleanMethods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
canBeUsed, checkApprovedOnlyModeStatus, isThreadCorrectMode, zeroize
-
Constructor Details
-
AsymmetricRSAPrivateKey
public AsymmetricRSAPrivateKey(Algorithm algorithm, BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger p, BigInteger q, BigInteger dp, BigInteger dq, BigInteger qInv) -
AsymmetricRSAPrivateKey
-
AsymmetricRSAPrivateKey
-
AsymmetricRSAPrivateKey
-
-
Method Details
-
getAlgorithm
Return the algorithm this RSA key is for.- Specified by:
getAlgorithmin interfaceKey- Overrides:
getAlgorithmin classAsymmetricRSAKey- Returns:
- the key's algorithm.
-
getModulus
Return the modulus for this RSA key.- Overrides:
getModulusin classAsymmetricRSAKey- Returns:
- the key's modulus.
-
getPublicExponent
-
getPrivateExponent
-
getP
-
getQ
-
getDP
-
getDQ
-
getQInv
-
getEncoded
public byte[] getEncoded()Description copied from interface:AsymmetricKeyReturn an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.- Specified by:
getEncodedin interfaceAsymmetricKey- Returns:
- an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
-
destroy
public void destroy()- Specified by:
destroyin interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyedin interfaceDestroyable
-
equals
Description copied from interface:KeyReturn true if o is an equivalent key to this. -
hashCode
public int hashCode()Description copied from interface:KeyReturn the hashCode for the key.
-