Interface TotpSecretCipher
- All Known Implementing Classes:
AesGcmTotpSecretCipher
public interface TotpSecretCipher
Port that protects TOTP secrets at rest.
-
Method Summary
-
Method Details
-
encrypt
byte[] encrypt(byte[] secret) Encrypts a secret.- Parameters:
secret- the clear secret.- Returns:
- the encrypted form, which includes whatever is needed to decrypt it.
-
decrypt
byte[] decrypt(byte[] encrypted) Decrypts a secret.- Parameters:
encrypted- a value produced byencrypt(byte[]).- Returns:
- the clear secret.
- Throws:
IllegalStateException- if the value was not produced by this cipher or was tampered with.
-