Package org.yamcs.security
Class CryptoUtils
- java.lang.Object
-
- org.yamcs.security.CryptoUtils
-
public class CryptoUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description CryptoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 String
generateRandomPassword(int length)
Generates a random strong password.static byte[]
generateRandomSecretKey()
Generates a difficult to guess random key via SecureRandom using the HmacSHA1 algorithm
-
-
-
Method Detail
-
generateRandomSecretKey
public static byte[] generateRandomSecretKey()
Generates a difficult to guess random key via SecureRandom using the HmacSHA1 algorithm
-
generateRandomPassword
public static String generateRandomPassword(int length)
Generates a random strong password.
-
calculateHmac
public static byte[] calculateHmac(String data, byte[] secret)
Calculates an hmac as specified in RFC2104.
-
calculateHmac
public static byte[] calculateHmac(byte[] data, byte[] secret)
Calculates an hmac as specified in RFC2104.
-
-