Class DefaultDPoPSingleUseChecker
java.lang.Object
com.nimbusds.oauth2.sdk.dpop.verifiers.DefaultDPoPSingleUseChecker
- All Implemented Interfaces:
SingleUseChecker<Map.Entry<DPoPIssuer,JWTID>>
@ThreadSafe
public class DefaultDPoPSingleUseChecker
extends Object
implements SingleUseChecker<Map.Entry<DPoPIssuer,JWTID>>
DPoP proof JWT single use checker. Caches a hash of the checked DPoP JWT
"jti" (JWT ID) claims for a given DPoP issuer. The checker should be
shut down when no longer in use.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDPoPSingleUseChecker(long lifetimeSeconds, long purgeIntervalSeconds) Creates a new DPoP proof JWT single use checker. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of cached items.voidmarkAsUsed(Map.Entry<DPoPIssuer, JWTID> object) Marks the specified object as used.voidshutdown()Shuts down this checker and frees any associated resources.
-
Constructor Details
-
DefaultDPoPSingleUseChecker
Creates a new DPoP proof JWT single use checker.- Parameters:
lifetimeSeconds- The lifetime of cached DPoP proof "jti" (JWT ID) claims, in seconds.purgeIntervalSeconds- The interval in seconds for purging the cached "jti" (JWT ID) claims of checked DPoP proofs.
-
-
Method Details
-
markAsUsed
Description copied from interface:SingleUseCheckerMarks the specified object as used.- Specified by:
markAsUsedin interfaceSingleUseChecker<Map.Entry<DPoPIssuer,JWTID>> - Parameters:
object- The object to mark as used. Must not benull.- Throws:
AlreadyUsedException- If the object was already marked as used.
-
getCacheSize
Returns the number of cached items.- Returns:
- The cached items, zero if none.
-
shutdown
Shuts down this checker and frees any associated resources.
-