public interface CSRFTokenSigner
This trait should not be used as a general purpose encryption utility.
Modifier and Type | Method and Description |
---|---|
play.api.libs.crypto.CSRFTokenSigner |
asScala()
Utility method needed for CSRFCheck.
|
boolean |
compareSignedTokens(java.lang.String tokenA,
java.lang.String tokenB)
Compare two signed tokens.
|
java.lang.String |
extractSignedToken(java.lang.String token)
Extract a signed token that was signed by
signToken(String) . |
java.lang.String |
generateSignedToken()
Generates a signed token by calling generateToken / signToken.
|
java.lang.String |
generateToken()
Generates a cryptographically secure token.
|
java.lang.String |
signToken(java.lang.String token)
Sign a token.
|
java.lang.String generateToken()
java.lang.String generateSignedToken()
java.lang.String signToken(java.lang.String token)
This primarily exists to defeat the BREACH vulnerability, as it allows the token to effectively be random per request, without actually changing the value.
token
- The token to signjava.lang.String extractSignedToken(java.lang.String token)
signToken(String)
.token
- The signed token to extract.boolean compareSignedTokens(java.lang.String tokenA, java.lang.String tokenB)
tokenA
- the first tokentokenB
- another tokenplay.api.libs.crypto.CSRFTokenSigner asScala()