Interface PrivateKeyObfuscator
- All Known Implementing Classes:
AbstractPrivateKeyObfuscator
,AESPrivateKeyObfuscator
,DESPrivateKeyObfuscator
,OpenSSHKeyPairResourceWriter.KeyEncryptor
public interface PrivateKeyObfuscator
-
Method Summary
Modifier and TypeMethodDescription<A extends Appendable>
AappendPrivateKeyEncryptionContext
(A sb, PrivateKeyEncryptionContext encContext) byte[]
applyPrivateKeyCipher
(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) byte[]
-
Method Details
-
getCipherName
String getCipherName()- Returns:
- Basic cipher used to obfuscate
-
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
-