public class AESPrivateKeyObfuscator extends AbstractPrivateKeyObfuscator
Modifier and Type | Class and Description |
---|---|
private static class |
AESPrivateKeyObfuscator.LazyValuesHolder |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CIPHER_NAME |
static AESPrivateKeyObfuscator |
INSTANCE |
Constructor and Description |
---|
AESPrivateKeyObfuscator() |
Modifier and Type | Method and Description |
---|---|
byte[] |
applyPrivateKeyCipher(byte[] bytes,
PrivateKeyEncryptionContext encContext,
boolean encryptIt) |
static java.util.List<java.lang.Integer> |
getAvailableKeyLengths() |
java.util.List<java.lang.Integer> |
getSupportedKeySizes() |
protected int |
resolveKeyLength(PrivateKeyEncryptionContext encContext) |
appendPrivateKeyEncryptionContext, applyPrivateKeyCipher, deriveEncryptionKey, generateInitializationVector, generateInitializationVector, getCipherName
public static final java.lang.String CIPHER_NAME
public static final AESPrivateKeyObfuscator INSTANCE
public java.util.List<java.lang.Integer> getSupportedKeySizes()
List
of the supported key sizes - Note: every
call returns a and un-modifiable instance.public byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) throws java.security.GeneralSecurityException
bytes
- Original bytesencContext
- The encryption contextencryptIt
- If true
then encrypt the original bytes, otherwise decrypt themjava.security.GeneralSecurityException
- If cannot encrypt/decryptprotected int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws java.security.GeneralSecurityException
resolveKeyLength
in class AbstractPrivateKeyObfuscator
java.security.GeneralSecurityException
public static java.util.List<java.lang.Integer> getAvailableKeyLengths()
List
of Integer
s holding the available key
lengths values (in bits) for the JVM. Note: AES 256 requires
special JCE policy extension installation (e.g., for Java 7 see
this link)