|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.security.token.SecretManager<JobTokenIdentifier>
org.apache.hadoop.mapreduce.security.token.JobTokenSecretManager
public class JobTokenSecretManager
SecretManager for job token. It can be used to cache generated job tokens.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.security.token.SecretManager |
|---|
SecretManager.InvalidToken |
| Constructor Summary | |
|---|---|
JobTokenSecretManager()
Default constructor |
|
| Method Summary | |
|---|---|
void |
addTokenForJob(String jobId,
Token<JobTokenIdentifier> token)
Add the job token of a job to cache |
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. |
| Methods inherited from class org.apache.hadoop.security.token.SecretManager |
|---|
createPassword, generateSecret |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JobTokenSecretManager()
| Method Detail |
|---|
public static SecretKey createSecretKey(byte[] key)
key - the byte[] to create the secret key from
public static byte[] computeHash(byte[] msg,
SecretKey key)
msg - the message to hashkey - the key to use
public byte[] createPassword(JobTokenIdentifier identifier)
createPassword in class SecretManager<JobTokenIdentifier>identifier - the job token identifier
public void addTokenForJob(String jobId,
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 removed
public SecretKey retrieveTokenSecret(String jobId)
throws SecretManager.InvalidToken
jobId - the jobId to look up
InvalidToken
SecretManager.InvalidToken
public byte[] retrievePassword(JobTokenIdentifier identifier)
throws SecretManager.InvalidToken
retrievePassword in class SecretManager<JobTokenIdentifier>identifier - the job token identifier to look up
InvalidToken
SecretManager.InvalidTokenpublic JobTokenIdentifier createIdentifier()
createIdentifier in class SecretManager<JobTokenIdentifier>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||