NTRUSigningPrivateKeyParameters (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.pqc.crypto.ntru

## Class NTRUSigningPrivateKeyParameters

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

- All Implemented Interfaces:
    CipherParameters

      public class NTRUSigningPrivateKeyParameters
      extends AsymmetricKeyParameter

  A NtruSign private key comprises one or more `NTRUSigningPrivateKeyParameters.Basis` of three polynomials each, except the zeroth basis for which `h` is undefined.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NTRUSigningPrivateKeyParameters.Basis` A NtruSign basis.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NTRUSigningPrivateKeyParameters(byte[] b, NTRUSigningKeyGenerationParameters params)` Constructs a new private key from a byte array
    `NTRUSigningPrivateKeyParameters(java.io.InputStream is, NTRUSigningKeyGenerationParameters params)` Constructs a new private key from an input stream
    `NTRUSigningPrivateKeyParameters(java.util.List<NTRUSigningPrivateKeyParameters.Basis> bases, NTRUSigningPublicKeyParameters publicKey)`

  - ### Method Summary

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

    - ### 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`

- - ### Constructor Detail

    - #### NTRUSigningPrivateKeyParameters

          public NTRUSigningPrivateKeyParameters(byte[] b,
                                         NTRUSigningKeyGenerationParameters params)
                                          throws java.io.IOException

      Constructs a new private key from a byte array
      Parameters:
        `b` - an encoded private key
        `params` - the NtruSign parameters to use
      Throws:
        `java.io.IOException`

    - #### NTRUSigningPrivateKeyParameters

          public NTRUSigningPrivateKeyParameters(java.io.InputStream is,
                                         NTRUSigningKeyGenerationParameters params)
                                          throws java.io.IOException

      Constructs a new private key from an input stream
      Parameters:
        `is` - an input stream
        `params` - the NtruSign parameters to use
      Throws:
        `java.io.IOException`

    - #### NTRUSigningPrivateKeyParameters

          public NTRUSigningPrivateKeyParameters(java.util.List<NTRUSigningPrivateKeyParameters.Basis> bases,
                                         NTRUSigningPublicKeyParameters publicKey)

  - ### Method Detail

    - #### getBasis

          public NTRUSigningPrivateKeyParameters.Basis getBasis(int i)

      Returns the `i`-th basis
      Parameters:
        `i` - the index
      Returns:
        the basis at index `i`

    - #### getPublicKey

          public NTRUSigningPublicKeyParameters getPublicKey()

    - #### getEncoded

          public byte[] getEncoded()
                            throws java.io.IOException

      Converts the key to a byte array
      Returns:
        the encoded key
      Throws:
        `java.io.IOException`

    - #### 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`

    - #### 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`