Package org.bouncycastle.pqc.jcajce.provider.rainbow

## Class BCRainbowPublicKey

- java.lang.Object
- - org.bouncycastle.pqc.jcajce.provider.rainbow.BCRainbowPublicKey

- All Implemented Interfaces:
    `java.io.Serializable`, `java.security.Key`, `java.security.PublicKey`

      public class BCRainbowPublicKey
      extends java.lang.Object
      implements java.security.PublicKey

  This class implements CipherParameters and PublicKey.

  The public key in Rainbow consists of n - v1 polynomial components of the private key's F and the field structure of the finite field k.

  The quadratic (or mixed) coefficients of the polynomials from the public key are stored in the 2-dimensional array in lexicographical order, requiring n * (n + 1) / 2 entries for each polynomial. The singular terms are stored in a 2-dimensional array requiring n entries per polynomial, the scalar term of each polynomial is stored in a 1-dimensional array.

  More detailed information on the public key is to be found in the paper of Jintai Ding, Dieter Schmidt: Rainbow, a New Multivariable Polynomial Signature Scheme. ACNS 2005: 164-175 (https://dx.doi.org/10.1007/11496137_12)

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BCRainbowPublicKey​(int docLength, short[][] coeffQuadratic, short[][] coeffSingular, short[] coeffScalar)` | Constructor
    `BCRainbowPublicKey​(RainbowPublicKeyParameters params)` |
    `BCRainbowPublicKey​(RainbowPublicKeySpec keySpec)` | Constructor (used by the `RainbowKeyFactorySpi`).

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(java.lang.Object other)` | Compare this Rainbow public key with another object.
    `java.lang.String` | `getAlgorithm()` |
    `short[][]` | `getCoeffQuadratic()` |
    `short[]` | `getCoeffScalar()` |
    `short[][]` | `getCoeffSingular()` |
    `int` | `getDocLength()` |
    `byte[]` | `getEncoded()` |
    `java.lang.String` | `getFormat()` |
    `int` | `hashCode()` |

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

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

- - ### Constructor Detail

    - #### BCRainbowPublicKey

          public BCRainbowPublicKey​(int docLength,
                                    short[][] coeffQuadratic,
                                    short[][] coeffSingular,
                                    short[] coeffScalar)

      Constructor
      Parameters:
        `docLength` -
        `coeffQuadratic` -
        `coeffSingular` -
        `coeffScalar` -

    - #### BCRainbowPublicKey

          public BCRainbowPublicKey​(RainbowPublicKeySpec keySpec)

      Constructor (used by the `RainbowKeyFactorySpi`).
      Parameters:
        `keySpec` - a `RainbowPublicKeySpec`

    - #### BCRainbowPublicKey

          public BCRainbowPublicKey​(RainbowPublicKeyParameters params)

  - ### Method Detail

    - #### getDocLength

          public int getDocLength()

      Returns:
        the docLength

    - #### getCoeffQuadratic

          public short[][] getCoeffQuadratic()

      Returns:
        the coeffQuadratic

    - #### getCoeffSingular

          public short[][] getCoeffSingular()

      Returns:
        the coeffSingular

    - #### getCoeffScalar

          public short[] getCoeffScalar()

      Returns:
        the coeffScalar

    - #### equals

          public boolean equals​(java.lang.Object other)

      Compare this Rainbow public key with another object.
      Overrides:
        `equals` in class `java.lang.Object`
      Parameters:
        `other` - the other object
      Returns:
        the result of the comparison

    - #### hashCode

          public int hashCode()

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

    - #### getAlgorithm

          public final java.lang.String getAlgorithm()

      Specified by:
        `getAlgorithm` in interface `java.security.Key`
      Returns:
        name of the algorithm - "Rainbow"

    - #### getFormat

          public java.lang.String getFormat()

      Specified by:
        `getFormat` in interface `java.security.Key`

    - #### getEncoded

          public byte[] getEncoded()

      Specified by:
        `getEncoded` in interface `java.security.Key`