Class TotpStoreRecord
java.lang.Object
com.revetsec.totp.TotpStoreRecord
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 Summary
Modifier and TypeMethodDescriptionstatic @NonNull TotpStoreRecordfromStoredForm(@NonNull TotpStoreKey key, @NonNull String version, byte @NonNull [] sealedBytes) Rehydrates an opaque bounded record, without granting protocol authority.getKey()Returns the exact record address.byte @NonNull []Returns a defensive copy of the sealed payload.Returns the exact version to preserve and compare atomically.toString()Redacts address, version and payload.
-
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 addressversion- the canonical unpadded base64url encoding of a fresh random 256-bit versionsealedBytes- 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
Returns a defensive copy of the sealed payload.- Returns:
- the sealed record
- Since:
- 1.0.0
-
toString
-