Package org.wildfly.security.encryption
Class SecretKeyUtil
- java.lang.Object
-
- org.wildfly.security.encryption.SecretKeyUtil
-
public class SecretKeyUtil extends Object
Utility methods for operating onSecretKey
instances.- Author:
- Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description private static String
SECRET_KEY_ALGORITHM
-
Constructor Summary
Constructors Constructor Description SecretKeyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static void
checkKeySize(int keySize)
static String
exportSecretKey(SecretKey secretKey)
static SecretKey
generateSecretKey(int keySize)
static SecretKey
importSecretKey(char[] rawData, int offset, int length)
static SecretKey
importSecretKey(String secretKey)
private static SecretKey
importSecretKey(org.wildfly.common.iteration.CodePointIterator codePointIterator)
-
-
-
Field Detail
-
SECRET_KEY_ALGORITHM
private static final String SECRET_KEY_ALGORITHM
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateSecretKey
public static SecretKey generateSecretKey(int keySize) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
exportSecretKey
public static String exportSecretKey(SecretKey secretKey) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
importSecretKey
public static SecretKey importSecretKey(char[] rawData, int offset, int length) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
importSecretKey
public static SecretKey importSecretKey(String secretKey) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
importSecretKey
private static SecretKey importSecretKey(org.wildfly.common.iteration.CodePointIterator codePointIterator) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
checkKeySize
private static void checkKeySize(int keySize) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
-