org.apache.hadoop.security.authentication.util
Class StringSignerSecretProvider

java.lang.Object
  extended by org.apache.hadoop.security.authentication.util.SignerSecretProvider
      extended by org.apache.hadoop.security.authentication.util.StringSignerSecretProvider

@InterfaceStability.Unstable
@InterfaceAudience.Private
public class StringSignerSecretProvider
extends SignerSecretProvider

A SignerSecretProvider that simply creates a secret based on a given String.


Constructor Summary
StringSignerSecretProvider()
           
 
Method Summary
 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

StringSignerSecretProvider

public StringSignerSecretProvider()
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

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 © 2014 Apache Software Foundation. All Rights Reserved.