Class NTRUSigningPublicKeyParameters

java.lang.Object
org.bouncycastle.crypto.params.AsymmetricKeyParameter
org.bouncycastle.pqc.legacy.crypto.ntru.NTRUSigningPublicKeyParameters
All Implemented Interfaces:
CipherParameters

public class NTRUSigningPublicKeyParameters extends AsymmetricKeyParameter
A NtruSign public key is essentially a polynomial named h.
  • Field Details

  • Constructor Details

    • NTRUSigningPublicKeyParameters

      public NTRUSigningPublicKeyParameters(IntegerPolynomial h, NTRUSigningParameters params)
      Constructs a new public key from a polynomial
      Parameters:
      h - the polynomial h which determines the key
      params - the NtruSign parameters to use
    • NTRUSigningPublicKeyParameters

      public NTRUSigningPublicKeyParameters(byte[] b, NTRUSigningParameters params)
      Converts a byte array to a polynomial h and constructs a new public key
      Parameters:
      b - an encoded polynomial
      params - the NtruSign parameters to use
    • NTRUSigningPublicKeyParameters

      public NTRUSigningPublicKeyParameters(InputStream is, NTRUSigningParameters params) throws IOException
      Reads a polynomial h from an input stream and constructs a new public key
      Parameters:
      is - an input stream
      params - the NtruSign parameters to use
      Throws:
      IOException
  • Method Details

    • getEncoded

      public byte[] getEncoded()
      Converts the key to a byte array
      Returns:
      the encoded key
    • writeTo

      public void writeTo(OutputStream os) throws IOException
      Writes the key to an output stream
      Parameters:
      os - an output stream
      Throws:
      IOException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object