Tabnine Logo
AesZipFileEncrypter
Code IndexAdd Tabnine to your IDE (free)

How to use
AesZipFileEncrypter
in
de.idyl.winzipaes

Best Java code snippets using de.idyl.winzipaes.AesZipFileEncrypter (Showing top 16 results out of 315)

origin: redfish64/TinyTravelTracker

/**
 * Zip + encrypt one "inFile" to one "outZipFile" using "password".
 */
public static void zipAndEncrypt(File inFile, File outFile, String password, AESEncrypter encrypter) throws IOException {
  AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter);
  try {
    enc.add(inFile, password);
  } finally {
    enc.close();
  }
}
origin: de.idyl/winzipaes

/**
 * Encrypt all files from an existing zip to one new "zipOutFile" using "password".
 */
public static void zipAndEncryptAll(File inZipFile, File outFile, String password, AESEncrypter encrypter) throws IOException {
  AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter);
  try {
    enc.addAll(inZipFile, password);
  } finally {
    enc.close();
  }
}
origin: redfish64/TinyTravelTracker

/**
 * Add un-encrypted + un-zipped file to encrypted zip file.<br>
 *
 * @param file to add
 * @param pathForEntry to be used for addition of the file (path within zip file)
 * @param password to be used for encryption
 */
public void add(File file, String pathForEntry, String password) throws IOException, UnsupportedEncodingException {
  FileInputStream fis = new FileInputStream(file);
  try {
    add(pathForEntry, fis, password);
  } finally {
    fis.close();
  }
}
origin: org.keycloak/keycloak-export-import-impl

public EncryptedZIPExportWriter(String zipFileName, String password) {
  try {
    this.zipFile = new File(zipFileName);
    if (zipFile.exists()) {
      throw new IllegalStateException("File " + zipFileName + " already exists");
    }
    this.objectMapper = JsonSerialization.mapper;
    AESEncrypter encrypter = new AESEncrypterBC();
    this.encrypter = new AesZipFileEncrypter(this.zipFile, encrypter);
    this.password = password;
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  }
}
origin: org.keycloak/keycloak-export-import-impl

  @Override
  public void closeExportWriter() {
    try {
      this.encrypter.close();
    } catch (IOException ioe) {
      throw new RuntimeException(ioe);
    }
  }
}
origin: de.idyl/winzipaes

/**
 * Add un-encrypted + un-zipped file to encrypted zip file.<br>
 *
 * @param file to add
 * @param pathForEntry to be used for addition of the file (path within zip file)
 * @param password to be used for encryption
 */
public void add(File file, String pathForEntry, String password) throws IOException, UnsupportedEncodingException {
  FileInputStream fis = new FileInputStream(file);
  try {
    add(pathForEntry, fis, password);
  } finally {
    fis.close();
  }
}
origin: redfish64/TinyTravelTracker

  zfe = new AesZipFileEncrypter(filePath, new AESEncrypterBC());
} catch (IOException e) {
  failedException = e;
origin: de.idyl/winzipaes

/**
 * Zip + encrypt one "inFile" to one "outZipFile" using "password".
 */
public static void zipAndEncrypt(File inFile, File outFile, String password, AESEncrypter encrypter) throws IOException {
  AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter);
  try {
    enc.add(inFile, password);
  } finally {
    enc.close();
  }
}
origin: redfish64/TinyTravelTracker

/**
 * Encrypt all files from an existing zip to one new "zipOutFile" using "password".
 */
public static void zipAndEncryptAll(File inZipFile, File outFile, String password, AESEncrypter encrypter) throws IOException {
  AesZipFileEncrypter enc = new AesZipFileEncrypter(outFile,encrypter);
  try {
    enc.addAll(inZipFile, password);
  } finally {
    enc.close();
  }
}
origin: org.keycloak/keycloak-export-import-impl

@Override
public <T> void writeEntities(String fileName, List<T> entities) {
  try {
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    this.objectMapper.writeValue(stream, entities);
    byte[] byteArray = stream.toByteArray();
    this.encrypter.add(fileName, new ByteArrayInputStream(byteArray), this.password);
  } catch (IOException ioe) {
    throw new RuntimeException(ioe);
  }
}
origin: redfish64/TinyTravelTracker

/**
 * Add un-encrypted + un-zipped file to encrypted zip file.
 * 
 * @param file to add, provides the path of the file within the zip file via its getPath()
 * @param password to be used for encryption
 */
public void add(File file, String password) throws IOException, UnsupportedEncodingException {
  FileInputStream fis = new FileInputStream(file);
  try {
    add(file.getPath(), fis, password);
  } finally {
    fis.close();
  }
}
origin: de.idyl/winzipaes

/**
 * Add un-encrypted + un-zipped file to encrypted zip file.
 * 
 * @param file to add, provides the path of the file within the zip file via its getPath()
 * @param password to be used for encryption
 */
public void add(File file, String password) throws IOException, UnsupportedEncodingException {
  FileInputStream fis = new FileInputStream(file);
  try {
    add(file.getPath(), fis, password);
  } finally {
    fis.close();
  }
}
origin: de.idyl/winzipaes

/**
 * Take all elements (files) from zip file and add them ENCRYPTED with password to the new zip
 * file created with this instance. <br>
 * Encrypted data of each file has the same size as the compressed data, though the file size is
 * increased by 26 bytes for salt and pw-verification bytes.<br>
 * While the {@link #add(File, String)} method does not need an additional zip file, this method
 * comes in handy, when your input data is larger than your available memory. 
 * 
 * @param pathToZipFile
 *          provides zipFileEntries for encryption
 * @param password
 *          used to perform the encryption
 * @throws IOException
 */
public void addAll(File pathToZipFile, String password) throws IOException {
  ZipFile zipFile = new ZipFile(pathToZipFile);
  try {
    add(zipFile, password);
  } finally {
    zipFile.close();
  }
}
origin: redfish64/TinyTravelTracker

/**
 * Take all elements (files) from zip file and add them ENCRYPTED with password to the new zip
 * file created with this instance. <br>
 * Encrypted data of each file has the same size as the compressed data, though the file size is
 * increased by 26 bytes for salt and pw-verification bytes.<br>
 * While the {@link #add(File, String)} method does not need an additional zip file, this method
 * comes in handy, when your input data is larger than your available memory. 
 * 
 * @param pathToZipFile
 *          provides zipFileEntries for encryption
 * @param password
 *          used to perform the encryption
 * @throws IOException
 */
public void addAll(File pathToZipFile, String password) throws IOException {
  ZipFile zipFile = new ZipFile(pathToZipFile);
  try {
    add(zipFile, password);
  } finally {
    zipFile.close();
  }
}
origin: de.idyl/winzipaes

protected void add(ZipFile inFile, String password) throws IOException,
    UnsupportedEncodingException {
  ZipFileEntryInputStream zfe = new ZipFileEntryInputStream(inFile.getName());			
  try {
    Enumeration<? extends ZipEntry> en = inFile.entries();
    while (en.hasMoreElements()) {
      ZipEntry ze = en.nextElement();
      zfe.nextEntry(ze);
      add(ze, zfe, password);
    }
  } finally {
    zfe.close();
  }
}
origin: redfish64/TinyTravelTracker

protected void add(ZipFile inFile, String password) throws IOException,
    UnsupportedEncodingException {
  ZipFileEntryInputStream zfe = new ZipFileEntryInputStream(inFile.getName());			
  try {
    Enumeration<? extends ZipEntry> en = inFile.entries();
    while (en.hasMoreElements()) {
      ZipEntry ze = en.nextElement();
      zfe.nextEntry(ze);
      add(ze, zfe, password);
    }
  } finally {
    zfe.close();
  }
}
de.idyl.winzipaesAesZipFileEncrypter

Javadoc

Create ZIP archive containing AES-256 encrypted entries.
One instance of this class represents one encrypted ZIP file, that can receive add() method calls that must be followed by one final call to close() to write the final archive part and close the output stream. zODO - support 128 + 192 keys

Most used methods

  • <init>
  • add
  • close
    Client is required to call this method after he added all entries so the final archive part is writt
  • addAll
    Take all elements (files) from zip file and add them ENCRYPTED with password to the new zip file cre

Popular in Java

  • Reactive rest calls using spring rest template
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • putExtra (Intent)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JCheckBox (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now