Package org.apache.pdfbox.pdmodel.encryption

Examples of org.apache.pdfbox.pdmodel.encryption.SecurityHandler


     *
     * @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


            COSDictionary trailer = cosDoc.getTrailer();
            trailer.removeItem(COSName.getPDFName("Encrypt"));
        }
        else
        {
            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

        }
        else
        {
            if (document.getEncryption() != null)
            {
                SecurityHandler securityHandler = document.getEncryption().getSecurityHandler();
                if(securityHandler != null)
                {
                    securityHandler.prepareDocumentForEncryption(document);
                    willEncrypt = true;
                }
                else
                {
                    willEncrypt = false;
View Full Code Here

        if (!isEncrypted())
        {
            encryption = new PDEncryption();
        }

        SecurityHandler securityHandler = SecurityHandlerFactory.INSTANCE.newSecurityHandlerForPolicy(policy);
        if (securityHandler == null)
        {
            throw new IOException("No security handler for policy " + policy);
        }
View Full Code Here

     */
    public void openProtection(DecryptionMaterial decryptionMaterial) throws IOException
    {
        if (isEncrypted())
        {
            SecurityHandler securityHandler = getEncryption().getSecurityHandler();
            securityHandler.decryptDocument(this, decryptionMaterial);
            accessPermission = securityHandler.getCurrentAccessPermission();
            document.dereferenceObjectStreams();
            document.setEncryptionDictionary(null);
            getDocumentCatalog();
        }
        else
View Full Code Here

            COSDictionary trailer = cosDoc.getTrailer();
            trailer.removeItem(COSName.ENCRYPT);
        }
        else
        {
            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 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

            COSDictionary trailer = cosDoc.getTrailer();
            trailer.removeItem(COSName.ENCRYPT);
        }
        else
        {
            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

TOP

Related Classes of org.apache.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.