Class NonceCounter


  • public class NonceCounter
    extends Object
    Thread-safe nonce count tracker for HTTP Digest Authentication (RFC 7616). Tracks the number of times each nonce has been used and returns the next nc value as an 8-digit hex string.
    • Constructor Detail

      • NonceCounter

        public NonceCounter()
    • Method Detail

      • nextNc

        public String nextNc​(String nonce)
        Returns the next nc value for the given nonce as an 8-digit hex string, atomically incrementing the counter.
      • reset

        public void reset​(String nonce)
        Removes tracking for the given nonce (e.g., on nextnonce rotation).