org.apache.hadoop.crypto.key
Class KeyProviderDelegationTokenExtension

java.lang.Object
  extended by org.apache.hadoop.crypto.key.KeyProvider
      extended by org.apache.hadoop.crypto.key.KeyProviderExtension<KeyProviderDelegationTokenExtension.DelegationTokenExtension>
          extended by org.apache.hadoop.crypto.key.KeyProviderDelegationTokenExtension

public class KeyProviderDelegationTokenExtension
extends KeyProviderExtension<KeyProviderDelegationTokenExtension.DelegationTokenExtension>

A KeyProvider extension with the ability to add a renewer's Delegation Tokens to the provided Credentials.


Nested Class Summary
static interface KeyProviderDelegationTokenExtension.DelegationTokenExtension
          DelegationTokenExtension is a type of Extension that exposes methods to needed to work with Delegation Tokens.
 
Nested classes/interfaces inherited from class org.apache.hadoop.crypto.key.KeyProviderExtension
KeyProviderExtension.Extension
 
Nested classes/interfaces inherited from class org.apache.hadoop.crypto.key.KeyProvider
KeyProvider.KeyVersion, KeyProvider.Metadata, KeyProvider.Options
 
Field Summary
 
Fields inherited from class org.apache.hadoop.crypto.key.KeyProvider
DEFAULT_BITLENGTH, DEFAULT_BITLENGTH_NAME, DEFAULT_CIPHER, DEFAULT_CIPHER_NAME
 
Method Summary
 org.apache.hadoop.security.token.Token<?>[] addDelegationTokens(String renewer, org.apache.hadoop.security.Credentials credentials)
          Passes the renewer and Credentials object to the underlying KeyProviderDelegationTokenExtension.DelegationTokenExtension
static KeyProviderDelegationTokenExtension createKeyProviderDelegationTokenExtension(KeyProvider keyProvider)
          Creates a KeyProviderDelegationTokenExtension using a given KeyProvider.
 
Methods inherited from class org.apache.hadoop.crypto.key.KeyProviderExtension
createKey, createKey, deleteKey, flush, getCurrentKey, getExtension, getKeyProvider, getKeys, getKeysMetadata, getKeyVersion, getKeyVersions, getMetadata, isTransient, rollNewVersion, rollNewVersion, toString
 
Methods inherited from class org.apache.hadoop.crypto.key.KeyProvider
buildVersionName, close, findProvider, generateKey, getBaseName, getConf, options
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addDelegationTokens

public org.apache.hadoop.security.token.Token<?>[] addDelegationTokens(String renewer,
                                                                       org.apache.hadoop.security.Credentials credentials)
                                                                throws IOException
Passes the renewer and Credentials object to the underlying KeyProviderDelegationTokenExtension.DelegationTokenExtension

Parameters:
renewer - the user allowed to renew the delegation tokens
credentials - cache in which to add new delegation tokens
Returns:
list of new delegation tokens
Throws:
IOException - thrown if IOException if an IO error occurs.

createKeyProviderDelegationTokenExtension

public static KeyProviderDelegationTokenExtension createKeyProviderDelegationTokenExtension(KeyProvider keyProvider)
Creates a KeyProviderDelegationTokenExtension using a given KeyProvider.

If the given KeyProvider implements the KeyProviderDelegationTokenExtension.DelegationTokenExtension interface the KeyProvider itself will provide the extension functionality, otherwise a default extension implementation will be used.

Parameters:
keyProvider - KeyProvider to use to create the KeyProviderDelegationTokenExtension extension.
Returns:
a KeyProviderDelegationTokenExtension instance using the given KeyProvider.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.