public class CryptoUtils extends Object
| Constructor and Description |
|---|
CryptoUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
base64Decode(String input,
boolean noNewLines) |
static String |
base64Encode(byte[] text,
boolean noNewLines) |
static byte[] |
computeClientKey(byte[] saltedPassword)
Calculate client key
|
static byte[] |
computeClientSignature(byte[] storedKey,
String authMessage)
Calculate client signature
|
static byte[] |
computeProof(byte[] clientKey,
byte[] clientSignature)
Calculate proof (XOR operation between client key and client signature)
|
static byte[] |
computeServerKey(byte[] saltedPassword)
Calculate server key
|
static byte[] |
computeServerSignature(byte[] serverKey,
String authMessage)
Calculate server signature
|
static byte[] |
computeStoredKey(byte[] clientKey)
Calculate stored key (SHA-256 hash of client key)
|
static String |
generateNonce(int length) |
static byte[] |
hmacSha256(byte[] key,
byte[] data)
Calculate HMAC-SHA256
|
static byte[] |
pbkdf2HmacSha256(String password,
byte[] salt,
int iterCount) |
static byte[] |
sha256(byte[] data)
Calculate SHA-256 hash
|
public static String base64Encode(byte[] text, boolean noNewLines)
public static byte[] base64Decode(String input, boolean noNewLines)
public static String generateNonce(int length)
public static byte[] pbkdf2HmacSha256(String password, byte[] salt, int iterCount)
public static byte[] computeClientKey(byte[] saltedPassword)
saltedPassword - Password processed with PBKDF2public static byte[] computeStoredKey(byte[] clientKey)
clientKey - Client keypublic static byte[] computeClientSignature(byte[] storedKey,
String authMessage)
storedKey - Stored keyauthMessage - Authentication messagepublic static byte[] computeProof(byte[] clientKey,
byte[] clientSignature)
clientKey - Client keyclientSignature - Client signaturepublic static byte[] computeServerKey(byte[] saltedPassword)
saltedPassword - Password processed with PBKDF2public static byte[] computeServerSignature(byte[] serverKey,
String authMessage)
serverKey - Server keyauthMessage - Authentication messagepublic static byte[] hmacSha256(byte[] key,
byte[] data)
key - HMAC keydata - Data to calculate HMAC forpublic static byte[] sha256(byte[] data)
data - Data to hashCopyright © 2025 DolphinDB. All rights reserved.