Examples of validateProtectionPassword()


Examples of org.apache.poi.xwpf.usermodel.XWPFDocument.validateProtectionPassword()

        // check leading 0
        assertEquals("0005CB00", CryptoFunctions.xorHashPassword("34579"));

        // test document write protection with password
        XWPFDocument document = XWPFTestDataSamples.openSampleDocument("bug56076.docx");
        boolean isValid = document.validateProtectionPassword("Example");
        assertTrue(isValid);
    }

    @Test
    public void bug56076_write() throws Exception {
View Full Code Here

Examples of org.apache.poi.xwpf.usermodel.XWPFDocument.validateProtectionPassword()

    public void bug56076_write() throws Exception {
        // test document write protection with password
        XWPFDocument document = new XWPFDocument();
        document.enforceCommentsProtection("Example", HashAlgorithm.sha512);
        document = XWPFTestDataSamples.writeOutAndReadBack(document);
        boolean isValid = document.validateProtectionPassword("Example");
        assertTrue(isValid);
    }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.