Interface ICipher

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] decrypt​(byte[] value)
      Decrypts an array of bytes.
      java.lang.String decrypt​(java.lang.String value)
      Decrypts a string.
      byte[] encrypt​(byte[] value)
      Encrypts an array of bytes.
      java.lang.String encrypt​(java.lang.String value)
      Encrypts a string.
    • Method Detail

      • encrypt

        java.lang.String encrypt​(java.lang.String value)
        Encrypts a string.
        Parameters:
        value - the original string.
        Returns:
        the encrypted string.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
        Since:
        5.5.0
      • decrypt

        java.lang.String decrypt​(java.lang.String value)
                          throws InvalidEncryptedValueException
        Decrypts a string.
        Parameters:
        value - the encrypted string.
        Returns:
        the string decrypted.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
        InvalidEncryptedValueException - if value is incompatible with this cipher (probably was not encrypted by it or is corrupted).
        java.lang.UnsupportedOperationException - if this is a one-way cipher and does not support decryption.
        Since:
        5.5.0
      • encrypt

        byte[] encrypt​(byte[] value)
        Encrypts an array of bytes.
        Parameters:
        value - the original value.
        Returns:
        the encrypted value.
        Throws:
        java.lang.IllegalArgumentException - if value is null.
        Since:
        5.5.0
      • decrypt

        byte[] decrypt​(byte[] value)
                throws InvalidEncryptedValueException
        Decrypts an array of bytes.
        Parameters:
        value - the encrypted value.
        Returns:
        the value decrypted.
        Throws:
        java.lang.UnsupportedOperationException - if this is a one-way cipher and does not support decryption.
        java.lang.IllegalArgumentException - if value is null.
        InvalidEncryptedValueException - if value is incompatible with this cipher (probably was not encrypted by it or is corrupted).
        Since:
        5.5.0