org.bouncycastle.bcpg

Class RSASecretBCPGKey

Implemented Interfaces:
BCPGKey

public class RSASecretBCPGKey
extends BCPGObject
implements BCPGKey

base class for an RSA Secret (or Private) Key.

Constructor Summary

RSASecretBCPGKey(BigInteger d, BigInteger p, BigInteger q)
RSASecretBCPGKey(BCPGInputStream in)

Method Summary

void
encode(BCPGOutputStream out)
BigInteger
getCrtCoefficient()
return the crt coefficient
byte[]
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 p
BigInteger
getPrimeExponentQ()
return the prime exponent of q
BigInteger
getPrimeP()
return the prime P
BigInteger
getPrimeQ()
return the prime Q
BigInteger
getPrivateExponent()
return the private exponent for this key.

Methods inherited from class org.bouncycastle.bcpg.BCPGObject

encode, getEncoded

Constructor Details

RSASecretBCPGKey

public RSASecretBCPGKey(BigInteger d,
                        BigInteger p,
                        BigInteger q)
Parameters:
d -
p -
q -

RSASecretBCPGKey

public RSASecretBCPGKey(BCPGInputStream in)
            throws IOException
Parameters:
in -

Method Details

encode

public void encode(BCPGOutputStream out)
            throws IOException
Overrides:
encode in interface BCPGObject

getCrtCoefficient

public BigInteger getCrtCoefficient()
return the crt coefficient

getEncoded

public byte[] getEncoded()
return the standard PGP encoding of the key.
Specified by:
getEncoded in interface BCPGKey
Overrides:
getEncoded in interface BCPGObject

getFormat

public String getFormat()
return "PGP"
Specified by:
getFormat in interface BCPGKey

getModulus

public BigInteger getModulus()
return the modulus for this key.
Returns:
BigInteger

getPrimeExponentP

public BigInteger getPrimeExponentP()
return the prime exponent of p

getPrimeExponentQ

public BigInteger getPrimeExponentQ()
return the prime exponent of q

getPrimeP

public BigInteger getPrimeP()
return the prime P

getPrimeQ

public BigInteger getPrimeQ()
return the prime Q

getPrivateExponent

public BigInteger getPrivateExponent()
return the private exponent for this key.
Returns:
BigInteger