Interface PrivateKeyObfuscator
-
- All Known Implementing Classes:
AbstractPrivateKeyObfuscator
,AESPrivateKeyObfuscator
,DESPrivateKeyObfuscator
,OpenSSHKeyPairResourceWriter.KeyEncryptor
public interface PrivateKeyObfuscator
- Author:
- Apache MINA SSHD Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends Appendable>
AappendPrivateKeyEncryptionContext(A sb, PrivateKeyEncryptionContext encContext)
byte[]
applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt)
byte[]
generateInitializationVector(PrivateKeyEncryptionContext encContext)
String
getCipherName()
List<Integer>
getSupportedKeySizes()
-
-
-
Method Detail
-
getCipherName
String getCipherName()
- Returns:
- Basic cipher used to obfuscate
-
getSupportedKeySizes
List<Integer> getSupportedKeySizes()
- Returns:
- A
List
of the supported key sizes - Note: every call returns a and un-modifiable instance.
-
appendPrivateKeyEncryptionContext
<A extends Appendable> A appendPrivateKeyEncryptionContext(A sb, PrivateKeyEncryptionContext encContext) throws IOException
- Type Parameters:
A
- Appendable generic type- Parameters:
sb
- TheAppendable
instance to updateencContext
-- Returns:
- Same appendable instance
- Throws:
IOException
-
generateInitializationVector
byte[] generateInitializationVector(PrivateKeyEncryptionContext encContext) throws GeneralSecurityException
- Parameters:
encContext
- The encryption context- Returns:
- An initialization vector suitable to the specified context
- Throws:
GeneralSecurityException
-
applyPrivateKeyCipher
byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) throws IOException, GeneralSecurityException
- 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:
IOException
- If malformed inputGeneralSecurityException
- If cannot encrypt/decrypt
-
-