T
- The type of the token identifierpublic abstract class SecretManager<T extends TokenIdentifier> extends Object
限定符和类型 | 类和说明 |
---|---|
static class |
SecretManager.InvalidToken
The token was invalid and the message explains why.
|
构造器和说明 |
---|
SecretManager() |
限定符和类型 | 方法和说明 |
---|---|
abstract T |
createIdentifier()
Create an empty token identifier.
|
protected static byte[] |
createPassword(byte[] identifier,
SecretKey key)
Compute HMAC of the identifier using the secret key and return the
output as password
|
protected abstract byte[] |
createPassword(T identifier)
Create the password for the given identifier.
|
protected static SecretKey |
createSecretKey(byte[] key)
Convert the byte[] to a secret key
|
protected SecretKey |
generateSecret()
Generate a new random secret key.
|
abstract byte[] |
retrievePassword(T identifier)
Retrieve the password for the given token identifier.
|
protected abstract byte[] createPassword(T identifier)
identifier
- the identifier to usepublic abstract byte[] retrievePassword(T identifier) throws SecretManager.InvalidToken
identifier
- the identifier to validateSecretManager.InvalidToken
- the token was invalidpublic abstract T createIdentifier()
protected SecretKey generateSecret()
protected static byte[] createPassword(byte[] identifier, SecretKey key)
identifier
- the bytes of the identifierkey
- the secret keyprotected static SecretKey createSecretKey(byte[] key)
key
- the byte[] to create a secret key fromCopyright © 2009 The Apache Software Foundation