Interface CookieSigner

  • All Known Implementing Classes:
    DefaultCookieSigner

    public interface CookieSigner
    Authenticates a cookie by returning a message authentication code (MAC).

    This interface should not be used as a general purpose MAC utility.

    • Method Detail

      • sign

        String sign​(String message)
        Signs the given String using the application's secret key.
        By default this uses the platform default JSSE provider. This can be overridden by defining application.crypto.provider in application.conf.
        Parameters:
        message - The message to sign.
        Returns:
        A hexadecimal encoded signature.
      • sign

        String sign​(String message,
                    byte[] key)
        Signs the given String using the given key.
        By default this uses the platform default JSSE provider. This can be overridden by defining application.crypto.provider in application.conf.
        Parameters:
        message - The message to sign.
        key - The private key to sign with.
        Returns:
        A hexadecimal encoded signature.
      • asScala

        play.api.libs.crypto.CookieSigner asScala()
        Returns:
        The Scala version for this cookie signer.