java.lang.Object
net.i2p.i2ptunnel.I2PTunnelHTTPClientBase.NonceInfo
Enclosing class:
I2PTunnelHTTPClientBase

private static class I2PTunnelHTTPClientBase.NonceInfoextends Object
Tracks nonce values for digest authentication.
  • Field Details

    • expires

      private final long expires
      When the nonce record expires.
    • counts

      private final BitSet counts
      Bits marking the nonces already used.
  • Constructor Details

    • NonceInfo

      public NonceInfo(long exp)
      Creates a nonce valid until the given time.
      Parameters:
      exp - the time in milliseconds after which the nonce is no longer accepted, as an absolute Clock.now() timestamp
  • Method Details

    • getExpires

      public long getExpires()
      When the nonce expires.
      Returns:
      the time in milliseconds after which this nonce is no longer accepted, as passed to the constructor
    • isValid

      public I2PTunnelHTTPClientBase.AuthResult isValid(int nc)
      Whether the nonce is still usable.
      Parameters:
      nc - the nonce count from the request, above zero and below MAX_NONCE_COUNT
      Returns:
      AUTH_GOOD when the nonce has not expired and this nonce count has not been seen before, otherwise AUTH_BAD or AUTH_STALE