Class TotpStoreRecord

java.lang.Object
com.revetsec.totp.TotpStoreRecord

@Immutable public final class TotpStoreRecord extends Object
Opaque permanent record with an authenticated address and non-reused version. No TTL is allowed. This carrier validates framing only; the authenticator establishes authenticity before use.
Since:
1.0.0
  • Method Details

    • fromStoredForm

      public static @NonNull TotpStoreRecord fromStoredForm(@NonNull TotpStoreKey key, @NonNull String version, byte @NonNull [] sealedBytes)
      Rehydrates an opaque bounded record, without granting protocol authority.
      Parameters:
      key - the exact address
      version - the canonical unpadded base64url encoding of a fresh random 256-bit version
      sealedBytes - the sealed payload, from 1 to 65536 bytes
      Returns:
      the immutable record
      Since:
      1.0.0
    • getKey

      Returns the exact record address.
      Returns:
      the address
      Since:
      1.0.0
    • getVersion

      Returns the exact version to preserve and compare atomically.
      Returns:
      the opaque non-reused version
      Since:
      1.0.0
    • getSealedBytes

      public byte @NonNull [] getSealedBytes()
      Returns a defensive copy of the sealed payload.
      Returns:
      the sealed record
      Since:
      1.0.0
    • toString

      Redacts address, version and payload.
      Overrides:
      toString in class Object
      Since:
      1.0.0