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

-     @InterfaceStability.Unstable
       @InterfaceAudience.Private
      public class FileSignerSecretProvider
      extends SignerSecretProvider

  A SignerSecretProvider that simply loads a secret from a specified file.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileSignerSecretProvider()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### FileSignerSecretProvider

          public FileSignerSecretProvider()

  - ### Method Detail

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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.