Class BCRSAPrivateCrtKey
java.lang.Object
org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateKey
org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateCrtKey
- All Implemented Interfaces:
Serializable,RSAKey,RSAPrivateCrtKey,RSAPrivateKey,Key,PrivateKey,PKCS12BagAttributeCarrier
public class BCRSAPrivateCrtKey extends BCRSAPrivateKey implements RSAPrivateCrtKey
A provider representation for a RSA private key, with CRT factors included.
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateKey
modulus, privateExponent -
Method Summary
Modifier and Type Method Description booleanequals(Object o)Compares this instance with the specified object and indicates if they are equal.BigIntegergetCrtCoefficient()return the CRT coefficient.byte[]getEncoded()Return a PKCS8 representation of the key.StringgetFormat()return the encoding format we produce in getEncoded().BigIntegergetPrimeExponentP()return the prime exponent for P.BigIntegergetPrimeExponentQ()return the prime exponent for Q.BigIntegergetPrimeP()return the prime P.BigIntegergetPrimeQ()return the prime Q.BigIntegergetPublicExponent()return the public exponent.inthashCode()Returns an integer hash code for this object.StringtoString()Returns a string containing a concise, human-readable description of this object.Methods inherited from class org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPrivateKey
getAlgorithm, getBagAttribute, getBagAttributeKeys, getModulus, getPrivateExponent, setBagAttributeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.security.Key
getAlgorithmMethods inherited from interface java.security.interfaces.RSAKey
getModulusMethods inherited from interface java.security.interfaces.RSAPrivateKey
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.
-
hashCode
public int hashCode()Description copied from class:ObjectReturns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually override both methods or neither method.Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classBCRSAPrivateKey- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
equals
Description copied from class:ObjectCompares this instance with the specified object and indicates if they are equal. In order to be equal,omust represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.The default implementation returns
trueonly ifthis == o. See Writing a correctequalsmethod if you intend implementing your ownequalsmethod.The general contract for the
equalsandObject.hashCode()methods is that ifequalsreturnstruefor any two objects, thenhashCode()must return the same value for these objects. This means that subclasses ofObjectusually override either both methods or neither of them.- Overrides:
equalsin classBCRSAPrivateKey- Parameters:
o- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
toString
Description copied from class:ObjectReturns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod.
-