Package org.bouncycastle.bcpg
Class RSASecretBCPGKey
java.lang.Object
org.bouncycastle.bcpg.BCPGObject
org.bouncycastle.bcpg.RSASecretBCPGKey
- All Implemented Interfaces:
BCPGKey
,org.bouncycastle.util.Encodable
base class for an RSA Secret (or Private) Key.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(BCPGOutputStream out) return the crt coefficientbyte[]
return the standard PGP encoding of the key.return "PGP"return the modulus for this key.return the prime exponent of preturn the prime exponent of qreturn the prime Preturn the prime Qreturn the private exponent for this key.
-
Constructor Details
-
RSASecretBCPGKey
- Parameters:
in
-- Throws:
IOException
-
RSASecretBCPGKey
- Parameters:
d
-p
-q
-
-
-
Method Details
-
getModulus
return the modulus for this key.- Returns:
- BigInteger
-
getPrivateExponent
return the private exponent for this key.- Returns:
- BigInteger
-
getPrimeP
return the prime P -
getPrimeQ
return the prime Q -
getPrimeExponentP
return the prime exponent of p -
getPrimeExponentQ
return the prime exponent of q -
getCrtCoefficient
return the crt coefficient -
getFormat
return "PGP" -
getEncoded
public byte[] getEncoded()return the standard PGP encoding of the key.- Specified by:
getEncoded
in interfaceBCPGKey
- Specified by:
getEncoded
in interfaceorg.bouncycastle.util.Encodable
- Overrides:
getEncoded
in classBCPGObject
- Returns:
- byte[]
- See Also:
-
encode
- Specified by:
encode
in classBCPGObject
- Throws:
IOException
-