Class RSAKey


public class RSAKey extends RSAPublicKey
Implementation of a private RSA Key
Author:
quisar
  • Constructor Details

  • Method Details

    • print

      public void print(PrintWriter out)
      Description copied from class: RSAPublicKey
      prints the key to a writer
      Overrides:
      print in class RSAPublicKey
      Parameters:
      out - writer to print to
    • print

      public void print(PrintStream out)
      Description copied from class: RSAPublicKey
      prints the key to a stream
      Overrides:
      print in class RSAPublicKey
      Parameters:
      out - stream to print to
    • generateKey

      public static RSAKey generateKey(int nbBits)
      generates a key pair
      Parameters:
      nbBits - size of the key
      Returns:
      RSAKey
    • decode

      public BigInteger decode(BigInteger message)
      decodes a BigInteger
      Parameters:
      message - BigInteger
      Returns:
      decoded BigInteger
    • decodeByteArray

      public byte[] decodeByteArray(byte[] message)
      decodes a byte array
      Parameters:
      message - array to decode
      Returns:
      decoded array
    • sign

      public BigInteger sign(BigInteger message)
      signs a message
      Parameters:
      message - message to sign
      Returns:
      signed message
    • getPublicKey

      public RSAPublicKey getPublicKey()
      gets the public key
      Returns:
      public key
    • getD

      public BigInteger getD()
      gets d
      Returns:
      d