FileSignerSecretProvider (Apache Hadoop Auth 3.5.0 API)
Description: declaration: package: org.apache.hadoop.security.authentication.util, class: FileSignerSecretProvider

Package org.apache.hadoop.security.authentication.util

# Class FileSignerSecretProvider

java.lang.Object
org.apache.hadoop.security.authentication.util.SignerSecretProvider
org.apache.hadoop.security.authentication.util.FileSignerSecretProvider

@Unstable @Private public class FileSignerSecretProvider extends SignerSecretProvider
A SignerSecretProvider that simply loads a secret from a specified file.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FileSignerSecretProvider()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[][]`
  `getAllSecrets()`
  Returns all secrets that a cookie could have been signed with and are still valid; this should include the secret returned by getCurrentSecret().
  `byte[]`
  `getCurrentSecret()`
  Returns the current secret to be used by the Signer for signing new cookies.
  `void`
  `init(Properties config, javax.servlet.ServletContext servletContext, long tokenValidity)`
  Initialize the SignerSecretProvider

  ### Methods inherited from class org.apache.hadoop.security.authentication.util.SignerSecretProvider

  `destroy`

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

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

- ## Constructor Details

  - ### FileSignerSecretProvider

    public FileSignerSecretProvider()

- ## Method Details

  - ### init

    public void init(Properties config, javax.servlet.ServletContext servletContext, long tokenValidity) throws Exception
    Description copied from class: `SignerSecretProvider`
    Initialize the SignerSecretProvider
    Specified by:
      `init` in class `SignerSecretProvider`
    Parameters:
      `config` - configuration properties
      `servletContext` - servlet context
      `tokenValidity` - The amount of time a token is valid for
    Throws:
      `Exception` - thrown if an error occurred

  - ### getCurrentSecret

    public byte[] getCurrentSecret()
    Description copied from class: `SignerSecretProvider`
    Returns the current secret to be used by the Signer for signing new cookies. This should never return null.

    Callers should be careful not to modify the returned value.

    Specified by:
      `getCurrentSecret` in class `SignerSecretProvider`
    Returns:
      the current secret

  - ### getAllSecrets

    public byte[][] getAllSecrets()
    Description copied from class: `SignerSecretProvider`
    Returns all secrets that a cookie could have been signed with and are still valid; this should include the secret returned by getCurrentSecret().

    Callers should be careful not to modify the returned value.

    Specified by:
      `getAllSecrets` in class `SignerSecretProvider`
    Returns:
      the secrets