@InterfaceAudience.Private @InterfaceStability.Unstable public class JobTokenSecretManager extends org.apache.hadoop.security.token.SecretManager<JobTokenIdentifier>
| Constructor and Description | 
|---|
JobTokenSecretManager()
Default constructor 
 | 
JobTokenSecretManager(SecretKey key)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addTokenForJob(String jobId,
              org.apache.hadoop.security.token.Token<JobTokenIdentifier> token)
Add the job token of a job to cache 
 | 
byte[] | 
computeHash(byte[] msg)
Compute the HMAC hash of the message using the key 
 | 
static byte[] | 
computeHash(byte[] msg,
           SecretKey key)
Compute the HMAC hash of the message using the key 
 | 
JobTokenIdentifier | 
createIdentifier()
Create an empty job token identifier 
 | 
byte[] | 
createPassword(JobTokenIdentifier identifier)
Create a new password/secret for the given job token identifier. 
 | 
static SecretKey | 
createSecretKey(byte[] key)
Convert the byte[] to a secret key 
 | 
void | 
removeTokenForJob(String jobId)
Remove the cached job token of a job from cache 
 | 
byte[] | 
retrievePassword(JobTokenIdentifier identifier)
Look up the token password/secret for the given job token identifier. 
 | 
SecretKey | 
retrieveTokenSecret(String jobId)
Look up the token password/secret for the given jobId. 
 | 
public JobTokenSecretManager()
public JobTokenSecretManager(SecretKey key)
public static SecretKey createSecretKey(byte[] key)
key - the byte[] to create the secret key frompublic static byte[] computeHash(byte[] msg,
                 SecretKey key)
msg - the message to hashkey - the key to usepublic byte[] computeHash(byte[] msg)
msg - the message to hashpublic byte[] createPassword(JobTokenIdentifier identifier)
createPassword in class org.apache.hadoop.security.token.SecretManager<JobTokenIdentifier>identifier - the job token identifierpublic void addTokenForJob(String jobId, org.apache.hadoop.security.token.Token<JobTokenIdentifier> token)
jobId - the job that owns the tokentoken - the job tokenpublic void removeTokenForJob(String jobId)
jobId - the job whose token is to be removedpublic SecretKey retrieveTokenSecret(String jobId) throws org.apache.hadoop.security.token.SecretManager.InvalidToken
jobId - the jobId to look upInvalidTokenorg.apache.hadoop.security.token.SecretManager.InvalidTokenpublic byte[] retrievePassword(JobTokenIdentifier identifier) throws org.apache.hadoop.security.token.SecretManager.InvalidToken
retrievePassword in class org.apache.hadoop.security.token.SecretManager<JobTokenIdentifier>identifier - the job token identifier to look upInvalidTokenorg.apache.hadoop.security.token.SecretManager.InvalidTokenpublic JobTokenIdentifier createIdentifier()
createIdentifier in class org.apache.hadoop.security.token.SecretManager<JobTokenIdentifier>Copyright © 2016 Apache Software Foundation. All rights reserved.