Class AsymmetricRSAPrivateKey

java.lang.Object
org.bouncycastle.crypto.asymmetric.AsymmetricRSAKey
org.bouncycastle.crypto.asymmetric.AsymmetricRSAPrivateKey
All Implemented Interfaces:
Destroyable, AsymmetricKey, AsymmetricPrivateKey, Key

public final class AsymmetricRSAPrivateKey extends AsymmetricRSAKey implements AsymmetricPrivateKey
Class for RSA private keys.
  • Constructor Details

  • Method Details

    • getAlgorithm

      public Algorithm getAlgorithm()
      Return the algorithm this RSA key is for.
      Specified by:
      getAlgorithm in interface Key
      Overrides:
      getAlgorithm in class AsymmetricRSAKey
      Returns:
      the key's algorithm.
    • getModulus

      public BigInteger getModulus()
      Return the modulus for this RSA key.
      Overrides:
      getModulus in class AsymmetricRSAKey
      Returns:
      the key's modulus.
    • getPublicExponent

      public BigInteger getPublicExponent()
    • getPrivateExponent

      public BigInteger getPrivateExponent()
    • getP

      public BigInteger getP()
    • getQ

      public BigInteger getQ()
    • getDP

      public BigInteger getDP()
    • getDQ

      public BigInteger getDQ()
    • getQInv

      public BigInteger getQInv()
    • getEncoded

      public byte[] getEncoded()
      Description copied from interface: AsymmetricKey
      Return an ASN.1 encoding of the key wrapped in a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
      Specified by:
      getEncoded in interface AsymmetricKey
      Returns:
      an encoding of a PrivateKeyInfo or a SubjectPublicKeyInfo structure.
    • destroy

      public void destroy()
      Specified by:
      destroy in interface Destroyable
    • isDestroyed

      public boolean isDestroyed()
      Specified by:
      isDestroyed in interface Destroyable
    • equals

      public boolean equals(Object o)
      Description copied from interface: Key
      Return true if o is an equivalent key to this.
      Specified by:
      equals in interface Key
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare to.
      Returns:
      true if o is the same or equivalent key, false otherwise.
    • hashCode

      public int hashCode()
      Description copied from interface: Key
      Return the hashCode for the key.
      Specified by:
      hashCode in interface Key
      Overrides:
      hashCode in class Object
      Returns:
      the key's hashCode.