Class AbstractPrivateKeyObfuscator
java.lang.Object
org.apache.sshd.common.config.keys.loader.AbstractPrivateKeyObfuscator
- All Implemented Interfaces:
PrivateKeyObfuscator
- Direct Known Subclasses:
AESPrivateKeyObfuscator
,DESPrivateKeyObfuscator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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[]
final String
protected abstract int
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
-
Field Details
-
algName
-
-
Constructor Details
-
AbstractPrivateKeyObfuscator
-
-
Method Details
-
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
-