Examples of PDEncryption


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

                COSObject trailerEncryptObj = (COSObject) trailerEncryptItem;
                parseDictionaryRecursive(trailerEncryptObj);
            }
            try
            {
                PDEncryption encryption = new PDEncryption(document.getEncryptionDictionary());

                DecryptionMaterial decryptionMaterial;
                if (keyStoreFilename != null)
                {
                    KeyStore ks = KeyStore.getInstance("PKCS12");
                    ks.load(new FileInputStream(keyStoreFilename), password.toCharArray());

                    decryptionMaterial = new PublicKeyDecryptionMaterial(ks, alias, password);
                }
                else
                {
                    decryptionMaterial = new StandardDecryptionMaterial(password);
                }

                securityHandler = encryption.getSecurityHandler();
                securityHandler.prepareForDecryption(encryption, document.getDocumentID(),
                        decryptionMaterial);
                accessPermission = securityHandler.getCurrentAccessPermission();
            }
            catch (Exception e)
View Full Code Here

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

    {
        if (encryption == null)
        {
            if (isEncrypted())
            {
                encryption = new PDEncryption(document.getEncryptionDictionary());
            }
        }
        return encryption;
    }
View Full Code Here

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

    @Deprecated
    public void encrypt(String ownerPassword, String userPassword) throws IOException
    {
        if (!isEncrypted())
        {
            encryption = new PDEncryption();
        }

        getEncryption().setSecurityHandler(new StandardSecurityHandler(
                new StandardProtectionPolicy(ownerPassword, userPassword, new AccessPermission())));
    }
View Full Code Here

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

     */
    public void protect(ProtectionPolicy policy) throws IOException
    {
        if (!isEncrypted())
        {
            encryption = new PDEncryption();
        }

        SecurityHandler securityHandler = SecurityHandlerFactory.INSTANCE.newSecurityHandlerForPolicy(policy);
        if (securityHandler == null)
        {
View Full Code Here

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

    {
        if (isEncrypted())
        {
            return false;
        }
        encryption = new PDEncryption();
        getEncryption().setSecurityHandler(securityHandler);
        return true;
    }
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.