SkeinParameters.Builder (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.crypto.params

## Class SkeinParameters.Builder

- java.lang.Object
- - org.bouncycastle.crypto.params.SkeinParameters.Builder

- Enclosing class:
    SkeinParameters

      public static class SkeinParameters.Builder
      extends java.lang.Object

  A builder for `SkeinParameters`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SkeinParameters.Builder()`
    `SkeinParameters.Builder(java.util.Hashtable paramsMap)`
    `SkeinParameters.Builder(SkeinParameters params)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SkeinParameters` | `build()` Constructs a new `SkeinParameters` instance with the parameters provided to this builder.
    `SkeinParameters.Builder` | `set(int type, byte[] value)` Sets a parameters to apply to the Skein hash function.
    `SkeinParameters.Builder` | `setKey(byte[] key)` Sets the `SkeinParameters.PARAM_TYPE_KEY` parameter.
    `SkeinParameters.Builder` | `setKeyIdentifier(byte[] keyIdentifier)` Sets the `SkeinParameters.PARAM_TYPE_KEY_IDENTIFIER` parameter.
    `SkeinParameters.Builder` | `setNonce(byte[] nonce)` Sets the `SkeinParameters.PARAM_TYPE_NONCE` parameter.
    `SkeinParameters.Builder` | `setPersonalisation(byte[] personalisation)` Sets the `SkeinParameters.PARAM_TYPE_PERSONALISATION` parameter.
    `SkeinParameters.Builder` | `setPersonalisation(java.util.Date date, java.util.Locale dateLocale, java.lang.String emailAddress, java.lang.String distinguisher)` Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification.
    `SkeinParameters.Builder` | `setPersonalisation(java.util.Date date, java.lang.String emailAddress, java.lang.String distinguisher)` Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification.
    `SkeinParameters.Builder` | `setPublicKey(byte[] publicKey)` Sets the `SkeinParameters.PARAM_TYPE_KEY_IDENTIFIER` parameter.

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

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

- - ### Constructor Detail

    - #### SkeinParameters.Builder

          public SkeinParameters.Builder()

    - #### SkeinParameters.Builder

          public SkeinParameters.Builder(java.util.Hashtable paramsMap)

    - #### SkeinParameters.Builder

          public SkeinParameters.Builder(SkeinParameters params)

  - ### Method Detail

    - #### set

          public SkeinParameters.Builder set(int type,
                                    byte[] value)

      Sets a parameters to apply to the Skein hash function.
      Parameter types must be in the range 0,5..62, and cannot use the value (reserved for message body).

      Parameters with type < are processed before the message content, parameters with type > are processed after the message and prior to output.

      Parameters:
        `type` - the type of the parameter, in the range 5..62.
        `value` - the byte sequence of the parameter.
      Returns:

    - #### setKey

          public SkeinParameters.Builder setKey(byte[] key)

      Sets the `SkeinParameters.PARAM_TYPE_KEY` parameter.

    - #### setPersonalisation

          public SkeinParameters.Builder setPersonalisation(byte[] personalisation)

      Sets the `SkeinParameters.PARAM_TYPE_PERSONALISATION` parameter.

    - #### setPersonalisation

          public SkeinParameters.Builder setPersonalisation(java.util.Date date,
                                                   java.lang.String emailAddress,
                                                   java.lang.String distinguisher)

      Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification.

      The format is `YYYYMMDD email@address distinguisher`, encoded to a byte sequence using UTF-8 encoding.

      Parameters:
        `date` - the date the personalised application of the Skein was defined.
        `emailAddress` - the email address of the creation of the personalised application.
        `distinguisher` - an arbitrary personalisation string distinguishing the application.
      Returns:
        the current builder.

    - #### setPersonalisation

          public SkeinParameters.Builder setPersonalisation(java.util.Date date,
                                                   java.util.Locale dateLocale,
                                                   java.lang.String emailAddress,
                                                   java.lang.String distinguisher)

      Implements the recommended personalisation format for Skein defined in Section 4.11 of the Skein 1.3 specification. You may need to use this method if the default locale doesn't use a Gregorian calender so that the GeneralizedTime produced is compatible implementations.

      The format is `YYYYMMDD email@address distinguisher`, encoded to a byte sequence using UTF-8 encoding.

      Parameters:
        `date` - the date the personalised application of the Skein was defined.
        `dateLocale` - locale to be used for date interpretation.
        `emailAddress` - the email address of the creation of the personalised application.
        `distinguisher` - an arbitrary personalisation string distinguishing the application.
      Returns:
        the current builder.

    - #### setPublicKey

          public SkeinParameters.Builder setPublicKey(byte[] publicKey)

      Sets the `SkeinParameters.PARAM_TYPE_KEY_IDENTIFIER` parameter.

    - #### setKeyIdentifier

          public SkeinParameters.Builder setKeyIdentifier(byte[] keyIdentifier)

      Sets the `SkeinParameters.PARAM_TYPE_KEY_IDENTIFIER` parameter.

    - #### setNonce

          public SkeinParameters.Builder setNonce(byte[] nonce)

      Sets the `SkeinParameters.PARAM_TYPE_NONCE` parameter.

    - #### build

          public SkeinParameters build()

      Constructs a new `SkeinParameters` instance with the parameters provided to this builder.