Interface PrivateKeyObfuscator

    • Method Detail

      • getCipherName

        java.lang.String getCipherName()
        Returns:
        Basic cipher used to obfuscate
      • getSupportedKeySizes

        java.util.List<java.lang.Integer> getSupportedKeySizes()
        Returns:
        A List of 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 - The Appendable instance to update
        encContext -
        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 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:
        java.io.IOException - If malformed input
        java.security.GeneralSecurityException - If cannot encrypt/decrypt