AbstractIdentifierWithHMACGenerator
@ThreadSafe public interface IdentifierWithHMACGenerator<T>
Implementations must be thread-safe.
Modifier and Type | Method | Description |
---|---|---|
T |
applyHMAC(com.nimbusds.jose.util.Base64URL value) |
Applies HMAC protection to the specified identifier value.
|
com.nimbusds.jose.util.Base64URL |
extractValue(T identifier) |
Extracts the raw value from the specified HMAC protected identifier
(to be used as a key in database queries, etc).
|
T |
generate() |
Generates a new secure random identifier with HMAC protection.
|
com.nimbusds.jose.util.Base64URL |
validateAndExtractValue(T identifier) |
Checks the HMAC of the specified identifier and returns its raw
value (to be used as a key in database queries, etc).
|
T generate()
T applyHMAC(com.nimbusds.jose.util.Base64URL value)
value
- The identifier value, BASE64-URL encoded. Must not be
empty or null
.com.nimbusds.jose.util.Base64URL extractValue(T identifier)
identifier
- The identifier with HMAC protection. Must not be
null
.com.nimbusds.jose.util.Base64URL validateAndExtractValue(T identifier) throws InvalidIdentifierException
identifier
- The identifier with HMAC protection. Must not be
null
.InvalidIdentifierException
- If the identifier format is
illegal or didn't pass the HMAC
check.Copyright © 2018 Connect2id. All rights reserved.