Class GMPrivateKey

java.lang.Object
edu.fiu.adwise.homomorphic_encryption.gm.GMPrivateKey
All Implemented Interfaces:
GMKey, Serializable, Key, PrivateKey, Destroyable

public class GMPrivateKey extends Object implements Serializable, PrivateKey, GMKey
This class represents the private key for the Goldwasser-Micali (GM) encryption scheme. It implements the PrivateKey and GMKey interfaces and provides access to the private key components \( p \), \( q \), and the modulus \( n \).
See Also:
  • Method Details

    • getAlgorithm

      public String getAlgorithm()
      Returns the algorithm name for this private key.
      Specified by:
      getAlgorithm in interface Key
      Returns:
      A string representing the algorithm name, "Goldwasser-Micali".
    • getFormat

      public String getFormat()
      Returns the format of the encoded key.
      Specified by:
      getFormat in interface Key
      Returns:
      A string representing the format, "PKCS#8".
    • getEncoded

      public byte[] getEncoded()
      Returns the encoded form of the private key. Currently, this method returns null.
      Specified by:
      getEncoded in interface Key
      Returns:
      A byte array representing the encoded key, or null.
    • getN

      public BigInteger getN()
      Retrieves the modulus \( n \) associated with this private key.
      Specified by:
      getN in interface GMKey
      Returns:
      The modulus \( n \) as a BigInteger.