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

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

# Class RandomSignerSecretProvider

java.lang.Object
org.apache.hadoop.security.authentication.util.SignerSecretProvider
org.apache.hadoop.security.authentication.util.RolloverSignerSecretProvider
org.apache.hadoop.security.authentication.util.RandomSignerSecretProvider

@Unstable @Private public class RandomSignerSecretProvider extends RolloverSignerSecretProvider
A SignerSecretProvider that uses a random number as its secret. It rolls the secret at a regular interval.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RandomSignerSecretProvider()`
  `RandomSignerSecretProvider(long seed)`
  This constructor lets you set the seed of the Random Number Generator and is meant for testing.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected byte[]`
  `generateNewSecret()`
  Subclasses should implement this to return a new secret.

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

  `destroy, getAllSecrets, getCurrentSecret, init, initSecrets, rollSecret, startScheduler`

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

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

- ## Constructor Details

  - ### RandomSignerSecretProvider

    public RandomSignerSecretProvider()

  - ### RandomSignerSecretProvider

    @VisibleForTesting public RandomSignerSecretProvider(long seed)
    This constructor lets you set the seed of the Random Number Generator and is meant for testing.
    Parameters:
      `seed` - the seed for the random number generator

- ## Method Details

  - ### generateNewSecret

    protected byte[] generateNewSecret()
    Description copied from class: `RolloverSignerSecretProvider`
    Subclasses should implement this to return a new secret. It will be called automatically at the secret rollover interval. It should never return null.
    Specified by:
      `generateNewSecret` in class `RolloverSignerSecretProvider`
    Returns:
      a new secret