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_LENGTHSstatic intDEFAULT_KEY_LENGTHstatic DESPrivateKeyObfuscatorINSTANCE
-
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 PrivateKeyEncryptionContextresolveEffectiveContext(PrivateKeyEncryptionContext encContext)protected intresolveInitializationVectorLength(PrivateKeyEncryptionContext encContext)protected intresolveKeyLength(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- Iftruethen 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
Listof the supported key sizes - Note: every call returns a and un-modifiable instance.
-
resolveKeyLength
protected int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Specified by:
resolveKeyLengthin classAbstractPrivateKeyObfuscator- Throws:
GeneralSecurityException
-
resolveInitializationVectorLength
protected int resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Specified by:
resolveInitializationVectorLengthin classAbstractPrivateKeyObfuscator- Throws:
GeneralSecurityException
-
resolveEffectiveContext
public static final PrivateKeyEncryptionContext resolveEffectiveContext(PrivateKeyEncryptionContext encContext)
-
-