Interface CryptoEngine

  • All Superinterfaces:
    CryptoProviderUnit, io.aether.utils.ToString

    public interface CryptoEngine
    extends CryptoProviderUnit
    Interface for an object that performs encryption and decryption with a stateful component, such as a nonce. Implementations of this interface will hold keys and other internal state necessary for the cryptographic process.
    • Method Detail

      • encrypt

        default byte[] encrypt​(byte[] data,
                               byte[] associatedData)
        Encrypts data and binds optional associated data to the packet. Null and empty associated data preserve the legacy wire format.
      • decrypt

        default byte[] decrypt​(byte[] data,
                               byte[] associatedData)
        Decrypts data and verifies optional associated data. No replay, nonce or sequence tracking is performed. Packets may be decrypted repeatedly and in arbitrary order.
      • encrypt

        byte[] encrypt​(byte[] data)
        Encrypts the provided data.
        Parameters:
        data - The data to be encrypted.
        Returns:
        The encrypted data.
      • decrypt

        byte[] decrypt​(byte[] data)
        Decrypts the provided data.
        Parameters:
        data - The data to be decrypted.
        Returns:
        The decrypted data.