public class AESPrivateKeyObfuscator extends AbstractPrivateKeyObfuscator
Modifier and Type | Field and Description |
---|---|
static 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 Predicate<CipherInformation> |
createCipherSelector(int keyLength,
String cipherMode) |
static List<Integer> |
getAvailableKeyLengths() |
List<Integer> |
getSupportedKeySizes() |
protected CipherInformation |
resolveCipherInformation(int keyLength,
String cipherMode) |
protected int |
resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext) |
protected int |
resolveKeyLength(PrivateKeyEncryptionContext encContext) |
appendPrivateKeyEncryptionContext, applyPrivateKeyCipher, deriveEncryptionKey, generateInitializationVector, getCipherName
public static final String CIPHER_NAME
public static final AESPrivateKeyObfuscator INSTANCE
public List<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 GeneralSecurityException, IOException
bytes
- Original bytesencContext
- The encryption contextencryptIt
- If true
then encrypt the original bytes, otherwise decrypt themGeneralSecurityException
- If cannot encrypt/decryptIOException
- If malformed inputprotected int resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
resolveInitializationVectorLength
in class AbstractPrivateKeyObfuscator
GeneralSecurityException
protected CipherInformation resolveCipherInformation(int keyLength, String cipherMode)
protected int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
resolveKeyLength
in class AbstractPrivateKeyObfuscator
GeneralSecurityException
public static Predicate<CipherInformation> createCipherSelector(int keyLength, String cipherMode)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.