Permissions with problem when encrypting pdf with certificate

I am using the following javascript code to encrypt a pdf using a certificate:
                    var thePermissions = {
                         allowAll: false,
                         allowAccessibility: false,
                         allowContentExtraction: false,
                         allowChanges: "none",
                         allowPrinting: "none"
                     var theCertificate = security.importFromFile(
                         "Certificate",
                         "/c/user.cer"
                     var theUserEntity = {
                         firstName: "The",
                         lastName: "User",
                         fullName: "The User",
                         certificates: theCertificate,
                         defaultEncryptCert: theCertificate
                     var theGroup = { userEntities: [ theUserEntity ], permissions: thePermissions };
                     encryptForRecipients( { oGroups: [ theGroup ] } );
                    saveAs("encrypted.pdf");
The file "encrypted.pdf" resulting is in fact encrypted, but the permissions doesn't seem to be correct. For instance, the Document Properties show that there are no document restrictions (DocumentProperties.PNG), but when the details are shown, it seems that the correct restrictions apply (DocumentSecurity.PNG). As can be seen in the permissions variable, there should be no permissions to the pdf generated. Can someone possibly help me with this?
Additional info: there should have no human interaction in the process, the certificate is not fixed (preventing using encryptUsingPolicy), and will be selected based on the file name of the original pdf.

Hi Leonard,
I see the same thing executing the script from the JavaScript console. There is a slight wrinkle in the steps to reproduce. Even if everything worked as it's supposed to, you would still need to close and then reopen the file in order to get the perm restrictions to take effect. This is because when you initially encrypt the file you are still the document owner, and thus none of the perms have yet taken effect. However, once you do close and then reopen the file (thus forcing an authentication), the file should open with the perms being enforced, but alas, they are not.
Interestingly, if you go into the Document Properties and then select the Security tab (or just click the Permissions Details button in the DMB) you see that the Restriction Summary shows that everything is allowed, but when you click the Show Details button, which just displays the restrictions applicable to the encryption handler, it shows the correct settings. Of course the real bug isn't that the restriction summary is incorrect, but rather that it is correct and all of the supposedly restricted operations are allowable.
I'll enter this as a bug against 10 along with the ER to add the encryption algorithm as an option to the encryptForRecipients JS function.
Steve

Similar Messages

  • Problems when reading pdf files

    I use windows 7, and also have available Adobe Reader 5 and Adobe Reader X, but i receive some problems when reading pdf files. What can I do???

    Reader 5 is not Windows Compatible. Two different versions of the same computer can cause all sorts of problems. Remove all Acrobat and/or Reader software then re-install Reader X.

  • Preserving filename when encrypting PDFs in Preview

    Dear All,
    When I encrypt PDFs using Preview in the normal way (Print -> PDF -> Set Security) everything works fine and the filename is preserved. However if I do this in Automator the filename gets given an alphanumeric name. I don't understand why this is. When I open that file, it asks for the password that I had originally set and it reveals the document.
    My workflow is like the following:
    Get Selected Finder Items (i am only selecting doc not docx)
    Convert Format of Word Documents (to pdfs)
    Encrypt PDF (Picked out from the Documet list)
    Move Finder Items (To desktop)
    Quit Application (Word in this case)
    All of the above seems to be just fine only that the filename gets converted to something else.
    On the system.log file I get the following entries (hope this helps!)
    Feb 1 12:07:10 Macintosh [0x0-0x300300].com.apple.Preview[17593]: Sun Feb 1 12:07:10 Macintosh.home Preview[17593] <Error>: CGCryptorProcessBytes: CCCryptorUpdate failed: error -4300.
    Feb 1 12:07:42: --- last message repeated 2 times ---
    Feb 1 12:09:38 Macintosh mdworker[17730]: (Error) Import: Importer force killed!
    Feb 1 12:09:38 Macintosh com.apple.launchd[1] (0x1004a0.mdworker[17730]): Exited with exit code: 1
    Feb 1 12:10:42 Macintosh /Applications/Microsoft Office 2008/Microsoft Word.app/Contents/MacOS/Microsoft Word[18057]: CPSGetProcessInfo(): This call is deprecated and should not be called anymore.
    Feb 1 12:10:42 Macintosh /Applications/Microsoft Office 2008/Microsoft Word.app/Contents/MacOS/Microsoft Word[18057]: CPSPBGetProcessInfo(): This call is deprecated and should not be called anymore.
    Feb 1 12:10:54 Macintosh /Applications/Automator.app/Contents/MacOS/Automator[4259]: setting security information: /Users/rjani5/Desktop/1zwCC1.pdf: Operation not permitted
    Many thanks in advance.
    Kind regards,
    Vnayak

    I played with the encrypt pdf action and it seems buggy. it can't replace the original (non-encrypted) pdf. instead it creates a temp file with a random alpha-numeric name and passes it to the next action. the way around it as i see it should be to first save the name of your word file in a text variable and after the encrypt action (or maybe after the move action) rename the resulting file. "rename finder items" doesn't seem to want to accept variables so you'll have to do the renaming via apple or shell script.

  • Problem when loading pdf files from Shared Content

    When I load pdf files from Shared Content, I got the following problem: "The selected document could not be retrieved, please try uploading the document again."
    Anyone knows this?
    Thank you very much in advanced.

    I don't migrated the program, but installed it from the original installer,
    i. e. I first installed Indesign from backup, and then uninstalled it and
    reinstall  clean from Adobe.
    What a plug-in or utility converts page from InDesign to PDF?
    2014-08-10 22:51 GMT+04:00 Peter Spier <[email protected]>:
        problem with exporting PDF files from InDesign CS5  created by Peter
    Spier <https://forums.adobe.com/people/P+Spier> in InDesign - View the
    full discussion <https://forums.adobe.com/message/6627440#6627440>

  • Excel chart alignment problems when creating PDF

    My excel chart is off set on my PDF page after creating PDF from Macro.  The chart is within my print areas in excel and no matter where I position the chart in excel the chart shows up like it is indented on the PDF and runs off the page.  I can print from excel and the results are fine.  I am operating a windows 2007 64 bit machine with excel 2007 and ADOBE Acrobat 9 Pro & Adobe Reader X.
    I am running the following code by Ron de Bruin to generate the PDF
    Myvar.ExportAsFixedFormat _
       Type:=xlTypePDF, _
       FileName:=Fname, _
       Quality:=xlQualityStandard, _
       IncludeDocProperties:=True, _
       IgnorePrintAreas:=False, _
      OpenAfterPublish:=OpenPDFAfterPublish
    No matter what I do I can not get the chart completely in the page through VBA.  The VBA code works fine it is the results of the PDF I can't seem to fix.
    Many thanks for any help.

    Hi,
         I tried to do the same with a Excel having a so much content. I tried to print that file into a PDF file, I saw the output file as expected. I think there might be some different settings in your PDF printer. Can you please send me the screenshot of PDF Printer Dialog Box launched after invoking Print To PDF from Excel?

  • Firewall problem when encrypting/decryting a file

    Hi,
    I'm a little bit new to cryptography.
    When I encrypt a file using the javax.crypto classes, my firewall pops up and says "java.exe is attempting to connect to a DNS Server".
    If I block the firewall, nothing else happens and the file gets encrypted as well. But I don't want to insecure all my customers having this firewall alerts.
    Can anyone help me to stop that ? Thanks in advance,
    - fridi -
    This is the example code I am using:
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.security.GeneralSecurityException;
    import javax.crypto.Cipher;
    import javax.crypto.CipherInputStream;
    import javax.crypto.SecretKey;
    import javax.crypto.SecretKeyFactory;
    import javax.crypto.spec.DESedeKeySpec;
    public class TestCrypt {
         public static void main(String[] args) throws Exception, GeneralSecurityException {
              String inFilename = args[0];
              String outFilename = args[1];
              byte[] keyArray = "My one and only key blablabalbal".getBytes();
              DESedeKeySpec desedeKeySpec = new DESedeKeySpec(keyArray);
              SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede");
              SecretKey key = keyFactory.generateSecret(desedeKeySpec);
              Cipher cip = Cipher.getInstance("DESede");
              cip.init(Cipher.ENCRYPT_MODE, key);
              FileInputStream fis = new FileInputStream(inFilename);
              CipherInputStream cis = new CipherInputStream(fis, cip);
              FileOutputStream fos = new FileOutputStream(outFilename);
              byte[] b = new byte[1024];
              int i = cis.read(b);
              while (i != -1) {
                   fos.write(b, 0, i);
                   i = cis.read(b);
              fos.close();
              cis.close();          
    }

    What version of Windows are you using, and what kind of security-related software are you running on the PC? Have you tried executing your code on a Linux/UNIX machine? It is highly unlikely that you'll see the problem on that platform - but if you do, there are tools where you can trace the execution of the JVM and filter it for name-service API calls to see where it is being initiated from.
    I would still bet that some software on your PC is causing the outbound call.

  • Have a problem when encrypt by RSA !!!

    I have a method
    public static byte[] EncryptByPublicKey(byte[] text, PublicKey key) {
            //byte[] encryptText = null;
            try {
                Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
                cipher.init(Cipher.ENCRYPT_MODE, key);
                return cipher.doFinal(text);
            catch (Exception e){
                System.out.println("Err " + e.toString());
            return null;
        }I write a class test this method
    public static void main(String[] args){
            PublicKey pub = ReadPublicKey("publicReceiver.k");
            String message = "abc";
            String encryptText =
                        new String(EncryptByPublicKey(message.getBytes(), pub));
            System.out.println(encryptText);
        }when I execute the minutes each are different results for each.
    help me please, thanks a lot of

    PKCS1 padding in encryption mode uses random bytes for the padding so you should pretty much always get a different resultant encrypted result.
    Note - the bytes of the ciphertext should never be turned into readable text using new String(ciphertext) since one cannot guarantee that all bytes and byte sequences are valid for your default character encoding. Use Base64 or Hex encoding.

  • SRVE0199E: OutputStream already obtained when exporting pdf

    Hi,
    I am have a problem when export pdf file from a web application. When I build with tomcat every works fine, but when deployed in Websphere. The problem occurred. It is that the exception stack being attached at the end of pdf file which prevents Adobe Acrobat 7 from open and displaying message like the file is damaged and could not be repaired. This is the exception stack,
    <H1>Error page exception</H1>
    <H4>The server cannot use the error page specified for your application to handle the Original Exception printed below. Please see the Error Page Exception below for a description of the problem with the specified error page.</H4>
    <BR><H3>Original Exception: </H3>
    <B>Error Message: </B>SRVE0199E: OutputStream already obtained<BR>
    <B>Error Code: </B>500<BR>
    <B>Target Servlet: </B>action<BR>
    <B>Error Stack: </B><BR>
    java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
    <BR>    
         at com.ibm.ws.webcontainer.srt.SRTServletResponse.getWriter&#40;SRTServletResponse.java&#40;Compiled Code&#41;&#41;
    <BR>    
         at org.apache.jasper.runtime.JspWriterImpl.initOut&#40;JspWriterImpl.java&#40;Inlined Compiled Code&#41;&#41;
    <BR>    
         at org.apache.jasper.runtime.JspWriterImpl.flushBuffer&#40;JspWriterImpl.java&#40;Compiled Code&#41;&#41;
    <BR>    
         at org.apache.jasper.runtime.PageContextImpl.release&#40;PageContextImpl.java&#40;Compiled Code&#41;&#41;
    <BR>    
         at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext&#40;JspFactoryImpl.java&#40;Inlined Compiled Code&#41;&#41;
    <BR>    
         at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext&#40;JspFactoryImpl.java&#40;Compiled Code&#41;&#41;
    <BR>    
         at com.ibm._jsp._exportResults._jspService&#40;_exportResults.java:104&#41;
    <BR>    ... there is more...
    and my code that generate pdf is,
    try {
    out = res.getOutputStream();
    PdfWriter.getInstance(document, out);
    document.open();
    Paragraph para = null;
    para = new Paragraph("Title", FontFactory.getFont("Arial", 20,Font.BOLD));
    document.add(para);
    } catch (DocumentException e1) {
    e1.printStackTrace();
    } catch (IOException e1) {
    e1.printStackTrace();
    document.close();
    please help me out because this is an urgent issue. Thanks.

    I didn't put this code within JSP, but inside javax.servlet.jsp.tagext.TagSupport. Is this the same as in JSP?
    While waiting for the answer, I also find that in TagSupport, there is a member variable, pageContext, that also has pageContext.getOut() which is a JspWriter. This is used to export to excel. But for exporting to pdf, i used PdfWriter.getInstance(document, res.getOutputStream()); and res = pageContext.getResponse();
    is this the main reason?

  • Cache Problem while loading PDF in IE

    Hi,
    I am getting a problem when I load a PDF from my servlet.
    I am using the following code.
    pdfInputStream = httpURLConnection.getInputStream();
    output = aResponse.getOutputStream();
    aResponse.setContentType("application/pdf");
    byte[] buffer = new byte[1024];
    int bytesRead = 0;
    while((bytesRead = pdfInputStream.read(buffer, 0, buffer.length)) >0) {
    output.write(buffer, 0, bytesRead);
    It works fine in Netscape. In IE it gives a problem when the PDF is very small 5KB and less. It does not show the report. When I click reload it shows it then.
    When I make the browser cache setting to "Every visit to page". It works fine.
    Then I tried to disable the cache for IE using the following code but this does not work in IE.
    pdfInputStream = httpURLConnection.getInputStream();
    output = aResponse.getOutputStream();
    aResponse.setContentType("application/pdf");
    aResponse.setHeader("Cache-Control", "no-cache"); //or
    aResponse.setHeader("Pragma", "no-cache"); //or
    aResponse.setDateHeader("Expires", 0);
    byte[] buffer = new byte[1024];
    int bytesRead = 0;
    while((bytesRead = pdfInputStream.read(buffer, 0, buffer.length)) >0) {
    output.write(buffer, 0, bytesRead);
    Each of the above methods did not work. IE was not recognising it as pdf any more and showing the save file box.
    Anybody have any solutions for this. There was another query of this kind but no answers for that.
    Regards,
    Ritesh

    This is not a cache problem.
    With IE you must specify the PDF content length you sent to browser.
    So:
    You must add aResponse.setContentLength(bytesTotal); where bytesTotal is the length of data sent to browser.

  • Problem creating a PDF file from other PDF files

    Normally, the process works, but sometimes produces the following error (in Spanish):
    El documento no se pudo archivar. Problema al leer el documento (110)
    Does anyone know the origin of the error? We have reviewed the security of files and is correct
    Thanks

    I am not sure, but it may be a font mismatch between the files. Fonts is one of the issues that often crops up as a problem when combining PDFs.

  • Adobe open encrypted PDF with expired certificate

    Hi,
    I encrypt and sign documents with certificates. To do this I use a script and the little program "jsignpdf". The certificates are stored in windows certificate store on the client.This works fine!
    The problem is that Adobe Reader (10/11) open the encrypted PDF also when the certificate is expired. I don't find any option to change that.
    Has anbody an idea to solve my problem?
    The clients have windows vista and Adobe Reader 10. But  Adobe Reader11 have the same problem.
    Thanks
    Steven

    If you are signing with Acrobat, you have the choice of whether to include revocation information. See Establish long-term signature validation in http://helpx.adobe.com/acrobat/using/validating-digital-signatures.html.

  • Discoverer Plus - Problem with Page Orientation when printing pdf's

    Hi,
    When printing pdf's in Disco Plus I have a problem:
    My workbooks are a mixture of landscape and portrait pages.
    I am printing the entire workbook and then using cutepdf to produce a pdf.
    If I print to paper I get the correct landscape/portrait settings.
    If I print to pdf then landscape pages appear vertically when I view on screen so that the text is running from bottom to top of the page.
    So it is picking up th portrait/landscape settings from the individual worksheets but cutepdf has not realised that the pages are landscape so they appear on the screen vertically.
    This was not a problem on discoverer desktop so I am confident that this is not a problem with cutepdf.
    Any thoughts?
    Justin

    Thanks 2257648922,
    Version details are as follows:
    OracleBI Discoverer 10g (10.1.2.3)
    Oracle Business Intelligence Discoverer Plus 10g (10.1.2.55.26)
    Discoverer Model - 10.1.2.55.26
    Discoverer Server - 10.1.2.55.26
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 10.1.2.55.26
    Oracle Database 10g Release 10.2.0.4.0 - Production
    Copyright © 1999, 2005, Oracle. All rights reserved.
    So I assume that means my version doesn't have the bug you mention.
    Any other thoughts would be appreciated.
    Justin

  • Printing problem when PDF is sent to the printer with certain fonts - missing text

    I'm running into a printing problem when PDFs containing certain characters of the Calibri font are used.  The text in large sections of the PDF is missing on the paper version, but the text is there on the screen.  It's also happened when the PDFs we created were e-mailed out to a client and printed on their printer.  The problem is not present when printing directly from the programs (Microsoft Word, Excel, Visio, etc.).  I've been trying to get tech support from Adobe on this, but every time I call they apologize and say they will call back in 4-6 hours with an answer.  Same result each time, no call back.  If anyone from Adobe is listening, it's case number 184891587.  The font appears as an embedded subset when I look at the document properties.  Sometimes deleting one or two Characters allows for larger text blocks to be printed - i.e. removing a long dash in bold from the heading of a paragraph makes the paragraph reappear when printed to paper from PDF.  In all cases the PDF appears correct on the screen.  Printing as an image allows the text to appear, but the image quality isn't acceptable for small text, even at the 600 dpi setting on the printer.  If the PDF is sent out by e-mail, we do not have control over the end-user's printer setup anyway, so we need this to work in all cases.  
    The setup/process I'm using is as follows:
    Windows 7 Professional SP1 64-Bit
    Microsoft Office 2013 - problem is present when printing documents from Word, Excel or Visio.  Even other variations on documents. 
    I've tried Acrobat versions 11.0.0 to 11.0.5 as well as Acrobat Pro 11.0.0 and 11.0.1.  Same Result
    Printing to Adobe PDF as the printer, from the third party application
    Printing to a Xerox printer from PDF using Acrobat - Text missing
    Client prints to Konica printer - Text missing
    I print to the wide-format Ricoh (which also does 11x17) and the text is present. 
    Is there something I'm missing?  Is the entire font not getting embedded into the PDF file?  I noticed that rolling back to a much older version of the Calibri font (1.02 compared to 5.72) makes the problem mostly go away, but it's not completely gone.  Is it possible the font is too large to be completely embedded?  Where can I go from here? 

    Success!  At least for now.  It looks like my problem was fixed with Adobe's most recent update, 11.0.06.  From the release notes:
    PDF creation
    Added support for Lotus Notes 9.
    Added support for WebCapture in IE 11.
    Added support for conversions from AutoCAD 2013.
    3652540 A blank pdf is created for files having hidden visual style.
    3601108 Flow Chart converts as a multicolored square.
    3654345 Word documents missing parts of images in conversion to PDF.
    3654572 Temporary file size increases when creating pdf by combining multiple files into one PDF.
    3670155 PDF file created with Distiller XI prints incorrectly to some printers. (Emphasis mine)
    3599407 Checkbox check marks do not appear in these files.
    3663233 IE Web Capture in localized OS: Icons and drop-down menu items are missing and conversion dialog is not localized.
    3651931 Chrome Only: Few web pages when converted to pdf from Chrome plugin doesn’t show up the Save As dialog.
    3597910 EPM Mode On: Web capture is not working on Windows 8-32 bit when cache folder is missing.
    3610644 Firefox 23.0: With Firefox version 23.0 (latest), the WebCapture icon shows up very dim as if it is disabled.
    3650244 ODA falis to convert DWG files to PDF for large files.
    I don't know if that's definately what solved the problem, but it sure sounds similar and this is the update that made the printing problem go away.  We can't get the PDFs to fail at this point with our printers, even with Calibri 5.72.  I'll come back to thread if we have printing problems at the end-user locations. 

  • Link problem when converting MS Word to PDF with Acrobat Professional

    Hello all,
    I have the following problem:
    When I have a MS Word document with links to other files inside and I convert it to PDF the links are converted from relative paths to absolute paths.
    The problem is created by Acrobat as the links in the MS Word file are relative (I have checked this by moving the different docs to another directory and confirmed that the links still work after the move).
    How can I make the paths in the PDF relative again? I know there is a plugin from Evermap (and I can confirm this works) but I do not want to use this plugin (=read: spend another $190 dollars) as the license for the Acrobat Professional is expensive enough . Is there a way I can convert the paths within Adobe Acrobat easily? Or better: can I adjust the settings in Acrobat to a new standard when all converted documents contain relative paths?
    Backgroundinfo:
    - Adobe Acrobat 8 Professional
    - Windows XP (SP2)
    - MS Word 2002
    Thanks in advance!
    Bart

    Dear Steve,
    I have tried what u suggested: I put all the documents (word + linked documents) into the same folder on the local-drive (C). Then I recreated the links  in the word document to be sure they were matching. After that I converted the word document to an PDF and confirmed the links were still working in the PDF document.
    Then the biggest challenge: copying the pdf and linked documents to another drive&directory. As you can guess: Unfortunately the links did not work anymore.
    Any other suggestions?
    If I use the Evermap-tool (30 day-trial) I can look at the links and this is how it is 'coded' in the pdf.
    first link: ../../../../test/link_a.pdf
    second link: ../../../../test/link_b.pdf
    and yes this will work if you put the documents in the directory test in the root of the local-drive but not in a different subdirectory.
    Anyone ideas?
    Grtz,
    Bart

  • Encrypt PDF with certificate (alternative to Acrobat?)

    Hi,
    we need to encrypt PDF document with a certificate of our company.
    We already worked with Acrobat's feature to do this, but we need to offer the possibility to encrypt documents to many of our employees.
    But only for this reason we don't want to buy licenses of Acrobat, so do you no alternative software that provides this feature?

    Hi,
    we need to encrypt PDF document with a certificate of our company.
    We already worked with Acrobat's feature to do this, but we need to offer the possibility to encrypt documents to many of our employees.
    But only for this reason we don't want to buy licenses of Acrobat, so do you no alternative software that provides this feature?

Maybe you are looking for

  • How to load Windows XP on a Macbook running 10.8.2

    I have a white MB running 10.8.2 and want to run Windows XP in a second partition on the internal drive.  Bootcamp assistant would not run without Windows 7.  I manually repartitioned the disk to create a Windows partition (formatted at FAT32) and in

  • Issue at Posting to FICO

    Hi Iam new to SAP-HR, I had an issue at posting to FICO. I had some wage types like basic, HRA,convayence, PT,ESI,PF ...... i want to create Symbolic account for these. I want to know what symbolic is related to what? i,e for basic what symbolic acco

  • Lightroom 5 print templates not allowing images to be moved into cells & not allowing individual cells to be selected

    I've run into a problem using the LR5 print templates that has occurred suddenly and I need help figuring out what happened. Yesterday I tried using a Print template from my User Templates menu and the one I selected wouldn't allow an image to be dra

  • N95 8gb loses signal when charging

    When i plug in the charger signal strengts drops to zero, i'm unable to make or receive any calls. I tried 2 chargers and both had same effect on the phone. In service center everything was fine, no signal drops, i was able to make and receive calls

  • Send email settings

    Hi, I am trying to send an email on a button click event. I do not see any error when the function module to send email is executed but I did not see any email to my personal email address too. Can you please guide me step by step that which all sett