Search in sources :

Example 1 with CryptoAPIEncryptor

use of org.apache.poi.poifs.crypt.cryptoapi.CryptoAPIEncryptor in project poi by apache.

the class HSLFSlideShowImpl method writeProperties.

/**
     * Writes out the standard Documment Information Properties (HPSF)
     *
     * @param outFS          the POIFSFileSystem to write the properties into
     * @param writtenEntries a list of POIFS entries to add the property names too
     * @throws IOException if an error when writing to the
     *                     {@link POIFSFileSystem} occurs
     */
@Override
protected void writeProperties(NPOIFSFileSystem outFS, List<String> writtenEntries) throws IOException {
    super.writeProperties(outFS, writtenEntries);
    DocumentEncryptionAtom dea = getDocumentEncryptionAtom();
    if (dea != null) {
        CryptoAPIEncryptor enc = (CryptoAPIEncryptor) dea.getEncryptionInfo().getEncryptor();
        try {
            // ignore OutputStream
            enc.getSummaryEntries(outFS.getRoot());
        } catch (IOException e) {
            throw e;
        } catch (GeneralSecurityException e) {
            throw new IOException(e);
        }
    }
}
Also used : DocumentEncryptionAtom(org.apache.poi.hslf.record.DocumentEncryptionAtom) CryptoAPIEncryptor(org.apache.poi.poifs.crypt.cryptoapi.CryptoAPIEncryptor) GeneralSecurityException(java.security.GeneralSecurityException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 DocumentEncryptionAtom (org.apache.poi.hslf.record.DocumentEncryptionAtom)1 CryptoAPIEncryptor (org.apache.poi.poifs.crypt.cryptoapi.CryptoAPIEncryptor)1