Interface TrustedDeviceTokenSigner


public interface TrustedDeviceTokenSigner
Port that signs the value of the trusted-device cookie and checks that signature, so a value the server did not issue is rejected before anything is looked up. A signed value has the form token.signature.
  • Method Summary

    Modifier and Type
    Method
    Description
    sign(String token)
    Signs a token.
    verify(String signedValue)
    Checks the signature of a cookie value, in constant time.
  • Method Details

    • sign

      String sign(String token)
      Signs a token.
      Parameters:
      token - the raw token of a trusted device.
      Returns:
      the value to put in the cookie: the token, a dot and its signature.
    • verify

      Optional<String> verify(String signedValue)
      Checks the signature of a cookie value, in constant time.
      Parameters:
      signedValue - the value presented by the browser, possibly null or malformed.
      Returns:
      the raw token when the value is well formed and its signature is valid; empty otherwise.