package java.util.zip; /** * Interface for ZIP encrypt/decrypt engine. * * @since 1.9 */ interface ZipCryption { /** * Calculate encription header * * @param e ZIP entry * @return ZIP encryption header */ public byte[] getEncryptionHeader(ZipEntry e); /** * Encrypt byte array. * @param data Byte array to encrypt * @param offset offset to start * @param length array length * @return Encrypted array. This instance is same to argument. */ public byte[] encryptBytes(byte[] data, int offset, int length); /** * Encrypt byte array. * @param data Byte array to encrypt * @return Encrypted array. This instance is same to argument. */ public byte[] encryptBytes(byte[] data); /** * Reset encryption engine. */ public void reset(); /** * Get ZIP encryption header. * @return sizeof encryption header. */ public int getEncryptionHeaderSize(); /** * Check encryption header * * @param e ZipEntry * @param encryptionHeader encryption header to be check * @return true if this encryption header is valid. */ public boolean isValid(ZipEntry e, byte[] encryptionHeader); /** * Decrypt byte array. * @param data Byte array to decrypt * @param offset offset to start * @param length array length * @return Decrypted array. This instance is same to argument. */ public byte[] decryptBytes(byte[] data, int offset, int length); /** * Decrypt byte array. * @param data Byte array to decrypt * @return Decrypted array. This instance is same to argument. */ public byte[] decryptBytes(byte[] data); }