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 Details

  • Method Details

    • 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 interface BCPGKey
      Returns:
      "RAW" or "PGP"
      See Also:
    • getEncoded

      public byte[] getEncoded()
      return the standard PGP encoding of the key.
      Specified by:
      getEncoded in interface BCPGKey
      Specified by:
      getEncoded in interface org.bouncycastle.util.Encodable
      Overrides:
      getEncoded in class BCPGObject
      Returns:
      byte[]
      See Also:
    • encode

      public void encode(BCPGOutputStream out) throws IOException
      Specified by:
      encode in class BCPGObject
      Throws:
      IOException