Package play.libs.crypto
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description play.api.libs.crypto.CookieSigner
asScala()
String
sign(String message)
Signs the given String using the application's secret key.String
sign(String message, byte[] key)
Signs the given String using the given key.
-
-
-
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 definingapplication.crypto.provider
inapplication.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 definingapplication.crypto.provider
inapplication.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.
-
-