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 TypeMethodDescriptionvoid
destroy()
boolean
Return 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()
int
hashCode()
Return the hashCode for the key.boolean
Methods 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:
getAlgorithm
in interfaceKey
- Overrides:
getAlgorithm
in classAsymmetricRSAKey
- Returns:
- the key's algorithm.
-
getModulus
Return the modulus for this RSA key.- Overrides:
getModulus
in classAsymmetricRSAKey
- Returns:
- the key's modulus.
-
getPublicExponent
-
getPrivateExponent
-
getP
-
getQ
-
getDP
-
getDQ
-
getQInv
-
getEncoded
public byte[] getEncoded()Description copied from interface:AsymmetricKey
Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.- Specified by:
getEncoded
in interfaceAsymmetricKey
- Returns:
- an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyed
in interfaceDestroyable
-
equals
Description copied from interface:Key
Return true if o is an equivalent key to this. -
hashCode
public int hashCode()Description copied from interface:Key
Return the hashCode for the key.
-