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
public class RSASecretBCPGKey extends BCPGObject implements BCPGKey
base class for an RSA Secret (or Private) Key.
-
-
Constructor Summary
Constructors Constructor Description RSASecretBCPGKey(BigInteger d, BigInteger p, BigInteger q)
RSASecretBCPGKey(BCPGInputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encode(BCPGOutputStream out)
BigInteger
getCrtCoefficient()
return the crt coefficientbyte[]
getEncoded()
return the standard PGP encoding of the key.String
getFormat()
return "PGP"BigInteger
getModulus()
return the modulus for this key.BigInteger
getPrimeExponentP()
return the prime exponent of pBigInteger
getPrimeExponentQ()
return the prime exponent of qBigInteger
getPrimeP()
return the prime PBigInteger
getPrimeQ()
return the prime QBigInteger
getPrivateExponent()
return the private exponent for this key.
-
-
-
Constructor Detail
-
RSASecretBCPGKey
public RSASecretBCPGKey(BCPGInputStream in) throws IOException
- Parameters:
in
-- Throws:
IOException
-
RSASecretBCPGKey
public RSASecretBCPGKey(BigInteger d, BigInteger p, BigInteger q)
- Parameters:
d
-p
-q
-
-
-
Method Detail
-
getModulus
public BigInteger getModulus()
return the modulus for this key.- Returns:
- BigInteger
-
getPrivateExponent
public BigInteger getPrivateExponent()
return the private exponent for this key.- Returns:
- BigInteger
-
getPrimeP
public BigInteger getPrimeP()
return the prime P
-
getPrimeQ
public BigInteger getPrimeQ()
return the prime Q
-
getPrimeExponentP
public BigInteger getPrimeExponentP()
return the prime exponent of p
-
getPrimeExponentQ
public BigInteger getPrimeExponentQ()
return the prime exponent of q
-
getCrtCoefficient
public BigInteger getCrtCoefficient()
return the crt coefficient
-
getFormat
public String getFormat()
return "PGP"- Specified by:
getFormat
in interfaceBCPGKey
- Returns:
- "RAW" or "PGP"
- See Also:
BCPGKey.getFormat()
-
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:
BCPGKey.getEncoded()
-
encode
public void encode(BCPGOutputStream out) throws IOException
- Specified by:
encode
in classBCPGObject
- Throws:
IOException
-
-