com.holonplatform.auth

## Interface Credentials

- All Superinterfaces:
    Serializable

      public interface Credentials
      extends Serializable

  Interface to represent credential data (such a passwords or account keys)
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `Credentials.Builder` Builder to create `Credentials` instances.
    `static interface` | `Credentials.Encoder` Builder to encode credentials using hash for secure storing.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Credentials.Builder` | `builder()` Builder to create Credentials instance
    `static Credentials.Encoder` | `encoder()` Credentials encoder
    `Date` | `getExpireDate()` Credential expire date
    `String` | `getHashAlgorithm()` Get hash algorithm used to encode secret.
    `int` | `getHashIterations()` Get hash iterations performed for secret encoding
    `byte[]` | `getSalt()` Get salt data used to hash secret
    `byte[]` | `getSecret()` Get secret data (e.g. password)
    `boolean` | `isBase64Encoded()` Whether secret is encoded using Base64.
    `boolean` | `isHexEncoded()` Whether secret is encoded using hexademical representation

- - ### Method Detail

    - #### getSecret

          byte[] getSecret()

      Get secret data (e.g. password)
      Returns:
        Secret

    - #### getHashAlgorithm

          String getHashAlgorithm()

      Get hash algorithm used to encode secret. If `null`, means secret is not hashed and `getSalt()` or `getHashIterations()` must be ignored.
      Returns:
        Hash algorithm name

    - #### getSalt

          byte[] getSalt()

      Get salt data used to hash secret
      Returns:
        Salt data

    - #### getHashIterations

          int getHashIterations()

      Get hash iterations performed for secret encoding
      Returns:
        Hash iterations

    - #### isBase64Encoded

          boolean isBase64Encoded()

      Whether secret is encoded using Base64. If `true` and hash algorithm is specified, any salt data will be considered Base64 encoded too.
      Returns:
        `true` if secret is encoded using Base64

    - #### isHexEncoded

          boolean isHexEncoded()

      Whether secret is encoded using hexademical representation
      Returns:
        `true` if secret is hex encoded

    - #### getExpireDate

          Date getExpireDate()

      Credential expire date
      Returns:
        Credential expire date, or `null` if credential never expires

    - #### builder

          static Credentials.Builder builder()

      Builder to create Credentials instance
      Returns:
        CredentialsBuilder

    - #### encoder

          static Credentials.Encoder encoder()

      Credentials encoder
      Returns:
        CredentialsEncoder

Copyright © 2019 The Holon Platform. All rights reserved.