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, getCipherNamepublic 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 AbstractPrivateKeyObfuscatorGeneralSecurityExceptionprotected CipherInformation resolveCipherInformation(int keyLength, String cipherMode)
protected int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
resolveKeyLength in class AbstractPrivateKeyObfuscatorGeneralSecurityExceptionpublic static Predicate<CipherInformation> createCipherSelector(int keyLength, String cipherMode)
Copyright © 2018–2020 The Apache Software Foundation. All rights reserved.