Class AbstractPrivateKeyObfuscator
- java.lang.Object
-
- org.apache.sshd.common.config.keys.loader.AbstractPrivateKeyObfuscator
-
- All Implemented Interfaces:
PrivateKeyObfuscator
- Direct Known Subclasses:
AESPrivateKeyObfuscator,DESPrivateKeyObfuscator
public abstract class AbstractPrivateKeyObfuscator extends Object implements PrivateKeyObfuscator
- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPrivateKeyObfuscator(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <A extends Appendable>
AappendPrivateKeyEncryptionContext(A sb, PrivateKeyEncryptionContext encContext)protected byte[]applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, int numBits, byte[] keyValue, boolean encryptIt)protected byte[]deriveEncryptionKey(PrivateKeyEncryptionContext encContext, int outputKeyLength)byte[]generateInitializationVector(PrivateKeyEncryptionContext encContext)StringgetCipherName()protected abstract intresolveInitializationVectorLength(PrivateKeyEncryptionContext encContext)protected abstract intresolveKeyLength(PrivateKeyEncryptionContext encContext)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.config.keys.loader.PrivateKeyObfuscator
applyPrivateKeyCipher, getSupportedKeySizes
-
-
-
-
Constructor Detail
-
AbstractPrivateKeyObfuscator
protected AbstractPrivateKeyObfuscator(String name)
-
-
Method Detail
-
getCipherName
public final String getCipherName()
- Specified by:
getCipherNamein interfacePrivateKeyObfuscator- Returns:
- Basic cipher used to obfuscate
-
generateInitializationVector
public byte[] generateInitializationVector(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Specified by:
generateInitializationVectorin interfacePrivateKeyObfuscator- Parameters:
encContext- The encryption context- Returns:
- An initialization vector suitable to the specified context
- Throws:
GeneralSecurityException
-
appendPrivateKeyEncryptionContext
public <A extends Appendable> A appendPrivateKeyEncryptionContext(A sb, PrivateKeyEncryptionContext encContext) throws IOException
- Specified by:
appendPrivateKeyEncryptionContextin interfacePrivateKeyObfuscator- Type Parameters:
A- Appendable generic type- Parameters:
sb- TheAppendableinstance to update- Returns:
- Same appendable instance
- Throws:
IOException
-
resolveInitializationVectorLength
protected abstract int resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
resolveKeyLength
protected abstract int resolveKeyLength(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Throws:
GeneralSecurityException
-
deriveEncryptionKey
protected byte[] deriveEncryptionKey(PrivateKeyEncryptionContext encContext, int outputKeyLength) throws IOException, GeneralSecurityException
- Throws:
IOExceptionGeneralSecurityException
-
applyPrivateKeyCipher
protected byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, int numBits, byte[] keyValue, boolean encryptIt) throws IOException, GeneralSecurityException- Throws:
IOExceptionGeneralSecurityException
-
-