Package org.yamcs.security
Class CryptoUtils
java.lang.Object
org.yamcs.security.CryptoUtils
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
calculateHmac
(byte[] data, byte[] secret) Calculates an hmac as specified in RFC2104.static byte[]
calculateHmac
(String data, byte[] secret) Calculates an hmac as specified in RFC2104.static CryptoUtils.PKCE
Generates an OAuth 2.0 Proof Key for Code Exchange (PKCE) code challenge and verifier (RFC6736)static String
generateRandomPassword
(int length) Generates a random strong password.static byte[]
Generates a difficult to guess random key via SecureRandom using the HmacSHA1 algorithm
-
Constructor Details
-
CryptoUtils
public CryptoUtils()
-
-
Method Details
-
generateRandomSecretKey
public static byte[] generateRandomSecretKey()Generates a difficult to guess random key via SecureRandom using the HmacSHA1 algorithm -
generateRandomPassword
Generates a random strong password. -
calculateHmac
Calculates an hmac as specified in RFC2104. -
calculateHmac
public static byte[] calculateHmac(byte[] data, byte[] secret) Calculates an hmac as specified in RFC2104. -
generatePKCE
Generates an OAuth 2.0 Proof Key for Code Exchange (PKCE) code challenge and verifier (RFC6736)code_challenge = BASE64URLENCODE(SHA256(ASCII(code_verifier)))
-