Class BrowserBinding

java.lang.Object
com.revetsec.BrowserBinding

@ThreadSafe public final class BrowserBinding extends Object
Bounded application-held correlation secret for browser pending workflows.

This value is not an authenticated browser, user, session, permission or recovery admission. A value restored from trusted persistence retains only its exact spelling; syntactic validity does not establish randomness, provenance or ownership. Untrusted request input must remain an untrusted comparison candidate and must not be passed to fromTrustedPersistence(String) merely to obtain this type.

The restoration ceiling is 65,536 Java UTF-16 code units. Individual protocols and stores retain every narrower rule, including strict UTF-8 where already required. The broad carrier deliberately preserves unmatched-surrogate spellings used by retained SAML pending state; it does not normalize text.

Since:
1.0.0
Author:
Mark Allen
  • Field Details

  • Method Details

    • fresh

      @CheckReturnValue public static @NonNull BrowserBinding fresh()
      Generates a fresh 32-byte application correlation secret in canonical unpadded Base64URL form.
      Returns:
      a fresh 43-character binding
      Since:
      1.0.0
    • fromTrustedPersistence

      @CheckReturnValue public static @NonNull BrowserBinding fromTrustedPersistence(@NonNull String value)
      Restores the exact value from application-controlled trusted persistence. This is not a parser for cookies, form fields, query parameters or other request input.
      Parameters:
      value - exact persisted correlation secret
      Returns:
      the bounded exact value
      Throws:
      IllegalArgumentException - if empty or longer than 65,536 Java UTF-16 code units
      Since:
      1.0.0
    • toSecretString

      Emits the correlation secret for protected persistence, an affected Revetsec operation or exact comparison. Never log, diagnose or expose this value to a browser response.
      Returns:
      the exact secret spelling
      Since:
      1.0.0
    • toString

      Overrides:
      toString in class Object
      Returns:
      a fixed redacted description