Class OperationBinding

java.lang.Object
com.revetsec.OperationBinding

@ThreadSafe public final class OperationBinding extends Object
Bounded application-held correlation secret for selected WebAuthn and TOTP operations.

The binding is not identity, permission, freshness, uniqueness or a one-use authorization grant. Applications still authorize the current session/action and atomically consume their own pending state. WebAuthn retains its canonical 43-character boundary; TOTP retains its historical nonempty, well-formed 1,024-code-unit boundary.

Since:
1.0.0
Author:
Mark Allen
  • Field Details

    • MAXIMUM_CODE_UNITS

      public static final @NonNull Integer MAXIMUM_CODE_UNITS
      Maximum trusted-persistence spelling retained for the TOTP compatibility profile.
      Since:
      1.0.0
  • Method Details

    • fresh

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

      @CheckReturnValue public static @NonNull OperationBinding fromTrustedPersistence(@NonNull String value)
      Restores an exact TOTP-compatible value from application-controlled trusted persistence. This is not a parser for untrusted browser or request input.
      Parameters:
      value - exact persisted correlation secret
      Returns:
      the bounded exact value
      Throws:
      IllegalArgumentException - if empty, longer than 1,024 Java UTF-16 code units or not well-formed UTF-16
      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