psiegman / epublib

a java library for reading and writing epub files
http://www.siegmann.nl/epublib
1.04k stars 313 forks source link

Library isn't reading encryption.xml file #98

Open jimitpatel opened 8 years ago

jimitpatel commented 8 years ago

The library has no functionality to read encryption.xml file. I have a file which has encrypted fonts and library failed to utilise those fonts.

jimitpatel commented 8 years ago

For sample, here is the encryption.xml file for the book I'm testing on

<?xml version="1.0" encoding="UTF-8"?>
<encryption xmlns="urn:oasis:names:tc:opendocument:xmlns:container" xmlns:enc="http://www.w3.org/2001/04/xmlenc#">
    <enc:EncryptedData>
        <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/>
        <enc:CipherData>
            <enc:CipherReference URI="OEBPS/Fonts/00004.ttf"/>
        </enc:CipherData>
    </enc:EncryptedData>
    <enc:EncryptedData>
        <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/>
        <enc:CipherData>
            <enc:CipherReference URI="OEBPS/Fonts/00005.ttf"/>
        </enc:CipherData>
    </enc:EncryptedData>
    <enc:EncryptedData>
        <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/>
        <enc:CipherData>
            <enc:CipherReference URI="OEBPS/Fonts/00003.ttf"/>
        </enc:CipherData>
    </enc:EncryptedData>
    <enc:EncryptedData>
        <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/>
        <enc:CipherData>
            <enc:CipherReference URI="OEBPS/Fonts/00002.ttf"/>
        </enc:CipherData>
    </enc:EncryptedData>
</encryption>

Also find TTF files in the zip attached. Fonts.zip