Class AsymmetricRSAPrivateKey
- java.lang.Object
-
- org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
-
- org.bouncycastle.crypto.asymmetric.AsymmetricRSAPrivateKey
-
- All Implemented Interfaces:
javax.security.auth.Destroyable,AsymmetricKey,AsymmetricPrivateKey,Key
public final class AsymmetricRSAPrivateKey extends AsymmetricRSAKey implements javax.security.auth.Destroyable, AsymmetricPrivateKey
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, modulus, rsaAlgIdentifier
-
-
Constructor Summary
Constructors Constructor Description AsymmetricRSAPrivateKey(Algorithm algorithm, byte[] privateKeyInfoEncoding)AsymmetricRSAPrivateKey(Algorithm algorithm, java.math.BigInteger modulus, java.math.BigInteger privateExponent)AsymmetricRSAPrivateKey(Algorithm algorithm, java.math.BigInteger modulus, java.math.BigInteger publicExponent, java.math.BigInteger privateExponent, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger dp, java.math.BigInteger dq, java.math.BigInteger qInv)AsymmetricRSAPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()booleanequals(java.lang.Object o)Return true if o is an equivalent key to this.protected voidfinalize()AlgorithmgetAlgorithm()Return the algorithm this RSA key is for.java.math.BigIntegergetDP()java.math.BigIntegergetDQ()byte[]getEncoded()Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.java.math.BigIntegergetModulus()Return the modulus for this RSA key.java.math.BigIntegergetP()java.math.BigIntegergetPrivateExponent()java.math.BigIntegergetPublicExponent()java.math.BigIntegergetQ()java.math.BigIntegergetQInv()inthashCode()Return the hashCode for the key.booleanisDestroyed()-
Methods inherited from class org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
canBeUsed, checkApprovedOnlyModeStatus, zeroize
-
-
-
-
Constructor Detail
-
AsymmetricRSAPrivateKey
public AsymmetricRSAPrivateKey(Algorithm algorithm, java.math.BigInteger modulus, java.math.BigInteger publicExponent, java.math.BigInteger privateExponent, java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger dp, java.math.BigInteger dq, java.math.BigInteger qInv)
-
AsymmetricRSAPrivateKey
public AsymmetricRSAPrivateKey(Algorithm algorithm, java.math.BigInteger modulus, java.math.BigInteger privateExponent)
-
AsymmetricRSAPrivateKey
public AsymmetricRSAPrivateKey(Algorithm algorithm, byte[] privateKeyInfoEncoding)
-
AsymmetricRSAPrivateKey
public AsymmetricRSAPrivateKey(Algorithm algorithm, PrivateKeyInfo privateKeyInfo)
-
-
Method Detail
-
getAlgorithm
public Algorithm getAlgorithm()
Return the algorithm this RSA key is for.- Specified by:
getAlgorithmin interfaceKey- Overrides:
getAlgorithmin classAsymmetricRSAKey- Returns:
- the key's algorithm.
-
getModulus
public java.math.BigInteger getModulus()
Return the modulus for this RSA key.- Overrides:
getModulusin classAsymmetricRSAKey- Returns:
- the key's modulus.
-
getPublicExponent
public java.math.BigInteger getPublicExponent()
-
getPrivateExponent
public java.math.BigInteger getPrivateExponent()
-
getP
public java.math.BigInteger getP()
-
getQ
public java.math.BigInteger getQ()
-
getDP
public java.math.BigInteger getDP()
-
getDQ
public java.math.BigInteger getDQ()
-
getQInv
public java.math.BigInteger getQInv()
-
getEncoded
public final 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 interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
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.
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-