Interface TotpSecretCipher


public interface TotpSecretCipher
Port that protects TOTP secrets at rest.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    decrypt(byte[] encrypted)
    Decrypts a secret.
    byte[]
    encrypt(byte[] secret)
    Encrypts a secret.
  • 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 by encrypt(byte[]).
      Returns:
      the clear secret.
      Throws:
      IllegalStateException - if the value was not produced by this cipher or was tampered with.