Class TotpStoreKey
java.lang.Object
com.revetsec.totp.TotpStoreKey
Canonical, namespace- and recovery-epoch-bound address of permanent TOTP state. Account IDs
appear only as domain-separated SHA-256 digests. Constructing an address confers no authority.
Storage addresses are sensitive and must not be logged.
- Since:
- 1.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares the complete persistence address.static @NonNull TotpStoreKeyforAccount(@NonNull String credentialNamespace, @NonNull String recoveryEpoch, @NonNull String accountId) Addresses the permanent account aggregate without disclosing its identifier in the address.static @NonNull TotpStoreKeyforNamespace(@NonNull String credentialNamespace, @NonNull String recoveryEpoch) Addresses the permanent namespace clock and initialization fence.static @NonNull TotpStoreKeyfromStoredForm(@NonNull String storageKey) Parses a bounded canonical persistence address; authenticity is checked when opening its record.Returns the credential namespace.getKind()Returns the permanent record kind.Returns the recovery epoch.Returns the exact sensitive persistence address.inthashCode()Returns the complete address hash.toString()Redacts the address.
-
Method Details
-
forNamespace
public static @NonNull TotpStoreKey forNamespace(@NonNull String credentialNamespace, @NonNull String recoveryEpoch) Addresses the permanent namespace clock and initialization fence.- Parameters:
credentialNamespace- the visible ASCII namespace, from 1 to 128 charactersrecoveryEpoch- the never-reused visible ASCII recovery epoch, from 1 to 128 characters- Returns:
- the namespace address
- Since:
- 1.0.0
-
forAccount
public static @NonNull TotpStoreKey forAccount(@NonNull String credentialNamespace, @NonNull String recoveryEpoch, @NonNull String accountId) Addresses the permanent account aggregate without disclosing its identifier in the address.- Parameters:
credentialNamespace- the visible ASCII namespacerecoveryEpoch- the never-reused recovery epochaccountId- the nonempty, well-formed account identifier, at most 1024 UTF-8 bytes- Returns:
- the account address
- Since:
- 1.0.0
-
fromStoredForm
Parses a bounded canonical persistence address; authenticity is checked when opening its record.- Parameters:
storageKey- the exact stored address- Returns:
- the parsed address
- Since:
- 1.0.0
-
getStorageKey
Returns the exact sensitive persistence address.- Returns:
- the address; never log it
- Since:
- 1.0.0
-
getCredentialNamespace
Returns the credential namespace.- Returns:
- the namespace
- Since:
- 1.0.0
-
getRecoveryEpoch
Returns the recovery epoch.- Returns:
- the epoch
- Since:
- 1.0.0
-
getKind
Returns the permanent record kind.- Returns:
- the kind
- Since:
- 1.0.0
-
equals
-
hashCode
-
toString
-