NTRUEncryptionPublicKeyParameters (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.pqc.crypto.ntru

## Class NTRUEncryptionPublicKeyParameters

- java.lang.Object
- - org.bouncycastle.crypto.params.AsymmetricKeyParameter
  - - org.bouncycastle.pqc.crypto.ntru.NTRUEncryptionKeyParameters
    - - org.bouncycastle.pqc.crypto.ntru.NTRUEncryptionPublicKeyParameters

- All Implemented Interfaces:
    CipherParameters

      public class NTRUEncryptionPublicKeyParameters
      extends NTRUEncryptionKeyParameters

  A NtruEncrypt public key is essentially a polynomial named `h`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IntegerPolynomial` | `h`

    - ### Fields inherited from class org.bouncycastle.pqc.crypto.ntru.NTRUEncryptionKeyParameters

      `params`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NTRUEncryptionPublicKeyParameters(byte[] b, NTRUEncryptionParameters params)` Converts a byte array to a polynomial `h` and constructs a new public key
    `NTRUEncryptionPublicKeyParameters(java.io.InputStream is, NTRUEncryptionParameters params)` Reads a polynomial `h` from an input stream and constructs a new public key
    `NTRUEncryptionPublicKeyParameters(IntegerPolynomial h, NTRUEncryptionParameters params)` Constructs a new public key from a polynomial

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `byte[]` | `getEncoded()` Converts the key to a byte array
    `int` | `hashCode()`
    `void` | `writeTo(java.io.OutputStream os)` Writes the key to an output stream

    - ### Methods inherited from class org.bouncycastle.pqc.crypto.ntru.NTRUEncryptionKeyParameters

      `getParameters`

    - ### Methods inherited from class org.bouncycastle.crypto.params.AsymmetricKeyParameter

      `isPrivate`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### h

          public IntegerPolynomial h

  - ### Constructor Detail

    - #### NTRUEncryptionPublicKeyParameters

          public NTRUEncryptionPublicKeyParameters(IntegerPolynomial h,
                                           NTRUEncryptionParameters params)

      Constructs a new public key from a polynomial
      Parameters:
        `h` - the polynomial `h` which determines the key
        `params` - the NtruEncrypt parameters to use

    - #### NTRUEncryptionPublicKeyParameters

          public NTRUEncryptionPublicKeyParameters(byte[] b,
                                           NTRUEncryptionParameters params)

      Converts a byte array to a polynomial `h` and constructs a new public key
      Parameters:
        `b` - an encoded polynomial
        `params` - the NtruEncrypt parameters to use
      See Also:
        `getEncoded()`

    - #### NTRUEncryptionPublicKeyParameters

          public NTRUEncryptionPublicKeyParameters(java.io.InputStream is,
                                           NTRUEncryptionParameters params)
                                            throws java.io.IOException

      Reads a polynomial `h` from an input stream and constructs a new public key
      Parameters:
        `is` - an input stream
        `params` - the NtruEncrypt parameters to use
      Throws:
        `java.io.IOException`
      See Also:
        `writeTo(OutputStream)`

  - ### Method Detail

    - #### getEncoded

          public byte[] getEncoded()

      Converts the key to a byte array
      Returns:
        the encoded key
      See Also:
        `NTRUEncryptionPublicKeyParameters(byte[], NTRUEncryptionParameters)`

    - #### writeTo

          public void writeTo(java.io.OutputStream os)
                       throws java.io.IOException

      Writes the key to an output stream
      Parameters:
        `os` - an output stream
      Throws:
        `java.io.IOException`
      See Also:
        `NTRUEncryptionPublicKeyParameters(InputStream, NTRUEncryptionParameters)`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`