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 Stringprotected abstract intprotected abstract intresolveKeyLength(PrivateKeyEncryptionContext encContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.config.keys.loader.PrivateKeyObfuscator
applyPrivateKeyCipher, getSupportedKeySizes
-
Field Details
-
algName
-
-
Constructor Details
-
AbstractPrivateKeyObfuscator
-
-
Method Details
-
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 updateencContext-- 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
-