public class JobTokenSecretManager extends SecretManager<JobTokenIdentifier>
SecretManager.InvalidToken
构造器和说明 |
---|
JobTokenSecretManager()
Default constructor
|
限定符和类型 | 方法和说明 |
---|---|
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.
|
createPassword, generateSecret
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[] createPassword(JobTokenIdentifier identifier)
createPassword
在类中 SecretManager<JobTokenIdentifier>
identifier
- the job token identifierpublic 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 removedpublic SecretKey retrieveTokenSecret(String jobId) throws SecretManager.InvalidToken
jobId
- the jobId to look upInvalidToken
SecretManager.InvalidToken
public byte[] retrievePassword(JobTokenIdentifier identifier) throws SecretManager.InvalidToken
retrievePassword
在类中 SecretManager<JobTokenIdentifier>
identifier
- the job token identifier to look upInvalidToken
SecretManager.InvalidToken
public JobTokenIdentifier createIdentifier()
createIdentifier
在类中 SecretManager<JobTokenIdentifier>
Copyright © 2009 The Apache Software Foundation