Skip to content

Commit 31dec56

Browse files
committed
[Improve] JWTUtil minor improvement
1 parent bfe59f1 commit 31dec56

File tree

1 file changed

+2
-1
lines changed
  • streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/authentication

1 file changed

+2
-1
lines changed

streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/authentication/JWTUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
import java.nio.ByteBuffer;
3535
import java.nio.charset.StandardCharsets;
36+
import java.security.SecureRandom;
3637
import java.util.Base64;
3738
import java.util.Date;
3839
import java.util.regex.Pattern;
@@ -184,7 +185,7 @@ public static boolean verify(String token) {
184185
public static String encrypt(String content) throws Exception {
185186
// Generate a random IV
186187
byte[] iv = new byte[GCM_IV_LENGTH];
187-
SECURE_RANDOM.nextBytes(iv);
188+
SecureRandom.getInstanceStrong().nextBytes(iv);
188189

189190
SecretKeySpec keySpec = new SecretKeySpec(JWT_KEY, "AES");
190191

0 commit comments

Comments
 (0)