public class CookieGenerator extends Object
Cookie = HMAC(Secret, Client - IP, Client - Parameters)as suggested here. Note: redesigned in 2.3 to use
ThreadLocalMac instead of
Mac.clone().| Modifier and Type | Field and Description |
|---|---|
static long |
COOKIE_LIFE_TIME
Key lifetime in nanos.
|
| Constructor and Description |
|---|
CookieGenerator() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generateCookie(ClientHello clientHello)
Generates a cookie in such a way that they can be verified without
retaining any per-client state on the server.
|
byte[] |
generatePastCookie(ClientHello clientHello)
Generates the cookie using the secret key of the past period.
|
public byte[] generateCookie(ClientHello clientHello) throws GeneralSecurityException
Cookie = HMAC(Secret, Client - IP, Client - Parameters)as suggested here.
clientHello - received client hello to generate a cookie forGeneralSecurityException - if the cookie cannot be computedpublic byte[] generatePastCookie(ClientHello clientHello) throws GeneralSecurityException
clientHello - received client hello to generate a cookie fornull,
if no secret key of the past period is available.GeneralSecurityException - if the cookie cannot be computedCopyright © 2023 Eclipse Foundation. All rights reserved.