Interface PrivateKeyObfuscator

All Known Implementing Classes:
AbstractPrivateKeyObfuscator, AESPrivateKeyObfuscator, DESPrivateKeyObfuscator, OpenSSHKeyPairResourceWriter.KeyEncryptor

public interface PrivateKeyObfuscator
  • Method Details

    • 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 - The Appendable instance to update
      encContext -
      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 bytes
      encContext - The encryption context
      encryptIt - If true then encrypt the original bytes, otherwise decrypt them
      Returns:
      The result of applying the cipher to the original bytes
      Throws:
      IOException - If malformed input
      GeneralSecurityException - If cannot encrypt/decrypt