public class EncryptionUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENCRYPTION_KEY_FILE_ID |
static String |
DEFAULT_ENCRYPTION_KEY_FILE_NAME |
static String |
DEFAULT_KEYFILE_NAME |
static String |
FILE_SEPARATOR |
static char[] |
PASSWORD |
static String |
providerClass |
static String |
SUBFOLDER |
| Constructor and Description |
|---|
EncryptionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asHex(byte[] buf)
Turns array of bytes into string
|
static boolean |
createKey(String filename,
int keysize,
String cipherName,
String cipherAlgorithm,
char[] password) |
static boolean |
generateAESKey(String keyfile,
int keysize) |
static void |
generatedDefaultKeyFile()
Deprecated.
|
static String |
getAbsolutePathForDefaultDefaultKeyFile()
Deprecated.
|
Map<ComposedType,List<AttributeDescriptor>> |
getAllTypesWhichHasEncyrptedAttributes() |
protected static ConfigIntf |
getConfig() |
Map<String,String> |
getConfiguredEncryptionKey() |
String |
getOldKeyFile() |
static PBEParameterSpec |
getOldPBEParameterSpec() |
static byte[] |
getOldSalt() |
Map<String,Integer> |
getUsedKeys(String type,
String qualifier,
JspContext jspc) |
static boolean |
isNewStyleKey(String keyfile) |
static SecretKey |
laodDefaultKey(String cipherName,
String cipherAlgorithm,
char[] password) |
static SecretKey |
loadKey(InputStream fis,
String cipherName,
String cipherAlgorithm,
char[] password) |
static SecretKey |
loadKey(String keyID) |
static SecretKey |
loadKey(String keyID,
String cipherName,
String cipherAlgorithm,
char[] password) |
void |
migrate(String type,
String attribute) |
void |
migrate(String type,
String qualifier,
JspContext jspc)
Performance (MacBook Pro/MySQL 5): Time: 1742901 m/s for '200100' steps-- 8 ms/step
|
public static final String SUBFOLDER
public static final String providerClass
public static final String FILE_SEPARATOR
public static final String DEFAULT_KEYFILE_NAME
public static char[] PASSWORD
public static final String DEFAULT_ENCRYPTION_KEY_FILE_ID
public static final String DEFAULT_ENCRYPTION_KEY_FILE_NAME
protected static ConfigIntf getConfig()
ConfigIntf (object) of the MasterTenantpublic String getOldKeyFile()
public void migrate(String type, String qualifier, JspContext jspc)
type - code of the ComposedTtypequalifier - name of the encrypted attributejspc - jspContextpublic Map<ComposedType,List<AttributeDescriptor>> getAllTypesWhichHasEncyrptedAttributes()
public static boolean generateAESKey(String keyfile, int keysize) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic static boolean createKey(String filename, int keysize, String cipherName, String cipherAlgorithm, char[] password) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic static SecretKey loadKey(String keyID) throws GeneralSecurityException, IOException
GeneralSecurityExceptionIOExceptionpublic static SecretKey laodDefaultKey(String cipherName, String cipherAlgorithm, char[] password) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, IOException
public static SecretKey loadKey(String keyID, String cipherName, String cipherAlgorithm, char[] password)
public static SecretKey loadKey(InputStream fis, String cipherName, String cipherAlgorithm, char[] password) throws IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException
public static final byte[] getOldSalt()
public static final PBEParameterSpec getOldPBEParameterSpec()
public static boolean isNewStyleKey(String keyfile)
@Deprecated public static void generatedDefaultKeyFile()
UnsupportedOperationException@Deprecated public static String getAbsolutePathForDefaultDefaultKeyFile()
generatedDefaultKeyFile()UnsupportedOperationExceptionpublic static String asHex(byte[] buf)
buf - Array of bytes to convert to hex stringCopyright © 2017 SAP SE. All Rights Reserved.