19 package org.turro.marker;
21 import java.net.URLDecoder;
22 import java.net.URLEncoder;
23 import java.nio.charset.StandardCharsets;
24 import java.time.Duration;
25 import java.time.Instant;
26 import java.time.temporal.ChronoUnit;
27 import org.turro.elephant.context.ElephantContext;
36 return URLEncoder.encode(
ElephantContext.
encrypt(Instant.now().plus(Duration.of(seconds, ChronoUnit.SECONDS)).toString()), StandardCharsets.UTF_8);
40 return Instant.parse(URLDecoder.decode(
ElephantContext.
decrypt(value), StandardCharsets.UTF_8)).isAfter(Instant.now());
static byte[] encrypt(byte[] value)
static byte[] decrypt(byte[] value)