Class BCRSAPrivateCrtKey
java.lang.Object
org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateKey
org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateCrtKey
- All Implemented Interfaces:
Serializable, AsymmetricKey, DEREncodablePREVIEW, RSAKey, RSAPrivateCrtKey, RSAPrivateKey, Key, PrivateKey, Destroyable, BCKey, PKCS12BagAttributeCarrier
A provider representation for a RSA private key, with CRT factors included.
- See Also:
-
Field Summary
Fields inherited from class BCRSAPrivateKey
algorithmIdentifier, attrCarrier, modulus, privateExponent, rsaPrivateKey -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroy this key, clearing the key material it holds.booleanreturn the CRT coefficient.byte[]Return a PKCS8 representation of the key.return the encoding format we produce in getEncoded().return the prime exponent for P.return the prime exponent for Q.return the prime P.return the prime Q.return the public exponent.inthashCode()toString()Methods inherited from class BCRSAPrivateKey
getAlgorithm, getBagAttribute, getBagAttributeKeys, getModulus, getPrivateExponent, hasFriendlyName, isDestroyed, setBagAttribute, setFriendlyNameMethods inherited from interface Destroyable
isDestroyedMethods inherited from interface Key
getAlgorithmMethods inherited from interface RSAKey
getModulusMethods inherited from interface RSAPrivateKey
getParams, getPrivateExponent
-
Method Details
-
getFormat
return the encoding format we produce in getEncoded().- Specified by:
getFormatin interfaceKey- Overrides:
getFormatin classBCRSAPrivateKey- Returns:
- the encoding format we produce in getEncoded().
-
getEncoded
public byte[] getEncoded()Return a PKCS8 representation of the key. The sequence returned represents a full PrivateKeyInfo object.- Specified by:
getEncodedin interfaceKey- Overrides:
getEncodedin classBCRSAPrivateKey- Returns:
- a PKCS8 representation of the key.
-
getPublicExponent
return the public exponent.- Specified by:
getPublicExponentin interfaceRSAPrivateCrtKey- Returns:
- the public exponent.
-
getPrimeP
return the prime P.- Specified by:
getPrimePin interfaceRSAPrivateCrtKey- Returns:
- the prime P.
-
getPrimeQ
return the prime Q.- Specified by:
getPrimeQin interfaceRSAPrivateCrtKey- Returns:
- the prime Q.
-
getPrimeExponentP
return the prime exponent for P.- Specified by:
getPrimeExponentPin interfaceRSAPrivateCrtKey- Returns:
- the prime exponent for P.
-
getPrimeExponentQ
return the prime exponent for Q.- Specified by:
getPrimeExponentQin interfaceRSAPrivateCrtKey- Returns:
- the prime exponent for Q.
-
getCrtCoefficient
return the CRT coefficient.- Specified by:
getCrtCoefficientin interfaceRSAPrivateCrtKey- Returns:
- the CRT coefficient.
-
destroy
public void destroy()Destroy this key, clearing the key material it holds.The CRT factors and exponents are dropped along with the inherited private exponent; the (public) modulus and public exponent are retained, so
hashCode()remains stable across destruction. SeeBCRSAPrivateKey.destroy()for the full contract.- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classBCRSAPrivateKey
-
hashCode
public int hashCode()- Overrides:
hashCodein classBCRSAPrivateKey
-
equals
- Overrides:
equalsin classBCRSAPrivateKey
-
toString
- Overrides:
toStringin classBCRSAPrivateKey
-