Interface PrivateKeyObfuscator
-
- All Known Implementing Classes:
AbstractPrivateKeyObfuscator,AESPrivateKeyObfuscator,DESPrivateKeyObfuscator,OpenSSHKeyPairResourceWriter.KeyEncryptor
public interface PrivateKeyObfuscator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends java.lang.Appendable>
AappendPrivateKeyEncryptionContext(A sb, PrivateKeyEncryptionContext encContext)byte[]applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt)byte[]generateInitializationVector(PrivateKeyEncryptionContext encContext)java.lang.StringgetCipherName()java.util.List<java.lang.Integer>getSupportedKeySizes()
-
-
-
Method Detail
-
getCipherName
java.lang.String getCipherName()
- Returns:
- Basic cipher used to obfuscate
-
getSupportedKeySizes
java.util.List<java.lang.Integer> getSupportedKeySizes()
- Returns:
- A
Listof the supported key sizes - Note: every call returns a and un-modifiable instance.
-
appendPrivateKeyEncryptionContext
<A extends java.lang.Appendable> A appendPrivateKeyEncryptionContext(A sb, PrivateKeyEncryptionContext encContext) throws java.io.IOException- Type Parameters:
A- Appendable generic type- Parameters:
sb- TheAppendableinstance to updateencContext-- Returns:
- Same appendable instance
- Throws:
java.io.IOException
-
generateInitializationVector
byte[] generateInitializationVector(PrivateKeyEncryptionContext encContext) throws java.security.GeneralSecurityException
- Parameters:
encContext- The encryption context- Returns:
- An initialization vector suitable to the specified context
- Throws:
java.security.GeneralSecurityException
-
applyPrivateKeyCipher
byte[] applyPrivateKeyCipher(byte[] bytes, PrivateKeyEncryptionContext encContext, boolean encryptIt) throws java.io.IOException, java.security.GeneralSecurityException- Parameters:
bytes- Original bytesencContext- The encryption contextencryptIt- Iftruethen encrypt the original bytes, otherwise decrypt them- Returns:
- The result of applying the cipher to the original bytes
- Throws:
java.io.IOException- If malformed inputjava.security.GeneralSecurityException- If cannot encrypt/decrypt
-
-