Package org.pdfbox.pdmodel.encryption

Examples of org.pdfbox.pdmodel.encryption.SecurityHandler


     */
    public void write(PDDocument doc) throws COSVisitorException
    {
        document = doc;
       
        SecurityHandler securityHandler = document.getSecurityHandler();
        if(securityHandler != null)
        {
            try
            {           
                securityHandler.prepareDocumentForEncryption(document);
                this.willEncrypt = true;
            }
            catch(IOException e)
            {
                throw new COSVisitorException( e );
View Full Code Here


     *
     * @throws BadSecurityHandlerException If there is an error during protection.
     */   
    public void protect(ProtectionPolicy pp) throws BadSecurityHandlerException
    {
        SecurityHandler handler = SecurityHandlersManager.getInstance().getSecurityHandler(pp);
        securityHandler = handler;
    }
View Full Code Here

        throws BadSecurityHandlerException, IOException, CryptographyException
    {
        PDEncryptionDictionary dict = this.getEncryptionDictionary();
        if(dict.getFilter() != null)
        {
            SecurityHandler handler = SecurityHandlersManager.getInstance().getSecurityHandler(dict.getFilter());
            securityHandler = handler;
            handler.decryptDocument(this, pm);
            document.dereferenceObjectStreams();
        }
        else
        {
            throw new RuntimeException("This document does not need to be decrypted");
View Full Code Here

TOP

Related Classes of org.pdfbox.pdmodel.encryption.SecurityHandler

Copyright © 2018 www.massapicom. 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.