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 beshut down
when no longer in use.
-
-
Constructor Summary
Constructors Constructor Description DefaultDPoPSingleUseChecker(long lifetimeSeconds, long purgeIntervalSeconds)
Creates a new DPoP proof JWT single use checker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCacheSize()
Returns the number of cached items.void
markAsUsed(Map.Entry<DPoPIssuer,JWTID> object)
Marks the specified object as used.void
shutdown()
Shuts down this checker and frees any associated resources.
-
-
-
Constructor Detail
-
DefaultDPoPSingleUseChecker
public DefaultDPoPSingleUseChecker(long lifetimeSeconds, long purgeIntervalSeconds)
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 Detail
-
markAsUsed
public void markAsUsed(Map.Entry<DPoPIssuer,JWTID> object) throws AlreadyUsedException
Description copied from interface:SingleUseChecker
Marks the specified object as used.- Specified by:
markAsUsed
in 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
public int getCacheSize()
Returns the number of cached items.- Returns:
- The cached items, zero if none.
-
shutdown
public void shutdown()
Shuts down this checker and frees any associated resources.
-
-