Package org.wildfly.security.encryption
Class SecretKeyUtil
- java.lang.Object
-
- org.wildfly.security.encryption.SecretKeyUtil
-
public class SecretKeyUtil extends Object
Utility methods for operating onSecretKeyinstances.- Author:
- Darran Lofthouse
-
-
Field Summary
Fields Modifier and Type Field Description private static StringSECRET_KEY_ALGORITHM
-
Constructor Summary
Constructors Constructor Description SecretKeyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static voidcheckKeySize(int keySize)static StringexportSecretKey(SecretKey secretKey)static SecretKeygenerateSecretKey(int keySize)static SecretKeyimportSecretKey(char[] rawData, int offset, int length)static SecretKeyimportSecretKey(String secretKey)private static SecretKeyimportSecretKey(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
-
-