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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
applyPrivateKeyCipher
(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) static final PrivateKeyEncryptionContext
resolveEffectiveContext
(PrivateKeyEncryptionContext encContext) protected int
protected int
resolveKeyLength
(PrivateKeyEncryptionContext encContext) Methods inherited from class org.apache.sshd.common.config.keys.loader.AbstractPrivateKeyObfuscator
appendPrivateKeyEncryptionContext, applyPrivateKeyCipher, deriveEncryptionKey, generateInitializationVector, getCipherName
-
Field Details
-
DEFAULT_KEY_LENGTH
public static final int DEFAULT_KEY_LENGTH- See Also:
-
AVAILABLE_KEY_LENGTHS
-
INSTANCE
-
-
Constructor Details
-
DESPrivateKeyObfuscator
public DESPrivateKeyObfuscator()
-
-
Method Details
-
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
- 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)
-