public class DESPrivateKeyObfuscator extends AbstractPrivateKeyObfuscator
Modifier and Type | Field and Description |
---|---|
static java.util.List<java.lang.Integer> |
AVAILABLE_KEY_LENGTHS |
static int |
DEFAULT_KEY_LENGTH |
static DESPrivateKeyObfuscator |
INSTANCE |
Constructor and Description |
---|
DESPrivateKeyObfuscator() |
Modifier and Type | Method and Description |
---|---|
byte[] |
applyPrivateKeyCipher(byte[] bytes,
PrivateKeyEncryptionContext encContext,
boolean encryptIt) |
protected byte[] |
generateInitializationVector(int keyLength) |
java.util.List<java.lang.Integer> |
getSupportedKeySizes() |
static PrivateKeyEncryptionContext |
resolveEffectiveContext(PrivateKeyEncryptionContext encContext) |
protected int |
resolveKeyLength(PrivateKeyEncryptionContext encContext) |
appendPrivateKeyEncryptionContext, applyPrivateKeyCipher, deriveEncryptionKey, generateInitializationVector, getCipherName
public static final int DEFAULT_KEY_LENGTH
public static final java.util.List<java.lang.Integer> AVAILABLE_KEY_LENGTHS
public static final DESPrivateKeyObfuscator INSTANCE
public byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) throws java.security.GeneralSecurityException, java.io.IOException
bytes
- Original bytesencContext
- The encryption contextencryptIt
- If true
then encrypt the original bytes, otherwise decrypt themjava.security.GeneralSecurityException
- If cannot encrypt/decryptjava.io.IOException
- If malformed inputpublic java.util.List<java.lang.Integer> getSupportedKeySizes()
List
of the supported key sizes - Note: every
call returns a and un-modifiable instance.protected int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws java.security.GeneralSecurityException
resolveKeyLength
in class AbstractPrivateKeyObfuscator
java.security.GeneralSecurityException
protected byte[] generateInitializationVector(int keyLength)
generateInitializationVector
in class AbstractPrivateKeyObfuscator
public static final PrivateKeyEncryptionContext resolveEffectiveContext(PrivateKeyEncryptionContext encContext)