Class DESPrivateKeyObfuscator
- java.lang.Object
-
- org.apache.sshd.common.config.keys.loader.AbstractPrivateKeyObfuscator
-
- org.apache.sshd.common.config.keys.loader.DESPrivateKeyObfuscator
-
- All Implemented Interfaces:
PrivateKeyObfuscator
public class DESPrivateKeyObfuscator extends AbstractPrivateKeyObfuscator
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static List<Integer>
AVAILABLE_KEY_LENGTHS
static int
DEFAULT_KEY_LENGTH
static DESPrivateKeyObfuscator
INSTANCE
-
Constructor Summary
Constructors Constructor Description DESPrivateKeyObfuscator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt)
List<Integer>
getSupportedKeySizes()
static PrivateKeyEncryptionContext
resolveEffectiveContext(PrivateKeyEncryptionContext encContext)
protected int
resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext)
protected int
resolveKeyLength(PrivateKeyEncryptionContext encContext)
-
Methods inherited from class org.apache.sshd.common.config.keys.loader.AbstractPrivateKeyObfuscator
appendPrivateKeyEncryptionContext, applyPrivateKeyCipher, deriveEncryptionKey, generateInitializationVector, getCipherName
-
-
-
-
Field Detail
-
DEFAULT_KEY_LENGTH
public static final int DEFAULT_KEY_LENGTH
- See Also:
- Constant Field Values
-
INSTANCE
public static final DESPrivateKeyObfuscator INSTANCE
-
-
Method Detail
-
applyPrivateKeyCipher
public byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) throws GeneralSecurityException, IOException
- Parameters:
bytes
- Original bytesencContext
- The encryption contextencryptIt
- Iftrue
then encrypt the original bytes, otherwise decrypt them- Returns:
- The result of applying the cipher to the original bytes
- Throws:
GeneralSecurityException
- If cannot encrypt/decryptIOException
- If malformed input
-
getSupportedKeySizes
public List<Integer> getSupportedKeySizes()
- Returns:
- A
List
of the supported key sizes - Note: every call returns a and un-modifiable instance.
-
resolveKeyLength
protected int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Specified by:
resolveKeyLength
in classAbstractPrivateKeyObfuscator
- Throws:
GeneralSecurityException
-
resolveInitializationVectorLength
protected int resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Specified by:
resolveInitializationVectorLength
in classAbstractPrivateKeyObfuscator
- Throws:
GeneralSecurityException
-
resolveEffectiveContext
public static final PrivateKeyEncryptionContext resolveEffectiveContext(PrivateKeyEncryptionContext encContext)
-
-