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 protected
AbstractPrivateKeyObfuscator(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)
String
getCipherName()
protected abstract int
resolveInitializationVectorLength(PrivateKeyEncryptionContext encContext)
protected abstract int
resolveKeyLength(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:
getCipherName
in interfacePrivateKeyObfuscator
- Returns:
- Basic cipher used to obfuscate
-
generateInitializationVector
public byte[] generateInitializationVector(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Specified by:
generateInitializationVector
in 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:
appendPrivateKeyEncryptionContext
in interfacePrivateKeyObfuscator
- Type Parameters:
A
- Appendable generic type- Parameters:
sb
- TheAppendable
instance 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:
IOException
GeneralSecurityException
-
applyPrivateKeyCipher
protected byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, int numBits, byte[] keyValue, boolean encryptIt) throws IOException, GeneralSecurityException
- Throws:
IOException
GeneralSecurityException
-
-