Unlock Encypted PDF Using certificates

Hi All,
I am using Encryption Service to unlock a pdf file and add reader extension rights to it.               API of the Encryption Service: unlockPDFUsingCredential(encryptDoc, keyAlias)  
key Alias- The input value is the friendly name i.e. alias of the key present in the IE key store.
This call fails with Error Message : ALC-ENC-100-013 Could not find credential from alias.
Caused By: findCredentialByAlias: no Local or HSM credential found -- No such object in the store(error code bin: 262, hex: 0x106)(CredentialServiceImpl.java466)
Note: The Acrobat pro is able to decrypt the encrypted doc but my LC call is failing.
Encryption is done using this call:
pkiIdentities -- This list has a recipeint which has a X509 cert (whose private key is used to unlock).
encryptPDFUsingCertificates(inDoc,pkiIdentities, certOptionsSpec);
Questions:
1) The API gives no information about the location of the keyStore where it is getting the handle of the key using the alias.
2) I looked at the removePDFCertificateSecurity(encryptDoc, keyAlias) API. That page describes the key should be rpesent in the Live cycle Store.
     Note: A private key is stored in the LiveCycle Trust Store. When a certificate is placed there, an alias value is specified.
How can I get a handle to LC Trust Store.
If possible please provice a sample code to do unlocking of the encrupted PDF.
--Thanks
greenday

I was able to find a cuase of the issue and this is how I solved the problem.
The alias required is privateKey firendly name in the LC Trust Store  so I have import the pfx credential in the LC Trust Store.
I used the CredentialServiceClient to import a credential and register it in the LC Trust Store with an alias.
--greendayX

Similar Messages

  • Secure PDF using certificate

    Hi All,
    I'm developing a secure PDF using certificate.
    When I open the PDF I get acrobat security saying " A digital ID was used to encrypt this document but no digital ID is present to decrypt it.Make sure your digital ID is properly installed or contact the document author. "
    Any help in resolving this issue is appreciated?

    I have the exact same problem with the following exception:
    I encrypted a portfolio with a public key for a committee, including myself, using our public keys to allow just us to be able to open the portfolio. This worked as it should with Acrobat 9.4.1 and Reader 9.4.1.
    When I updated to Adobe Reader X, I got the infamous
    "Acrobat Security
    A digital ID was used to encrypt this document but no digital ID is present to decrypt it. Make sure your digital ID is properly installed or contact the document author" message.
    On this same computer I can open the portfolio with Acrobat 9.4.1 and it doesn't prompt me for a password. When I open the same portfolio with Adobe Reader X, it asks for the password and gives the message.
    When I upgraded to Reader X, I completely  removed Reader 9 prior to loading Reader X. After a successful upgrade, I set my preferences to match what I had with Reader 9. Next, I re-established my security settings as follows:
    1) Edit>Protection>Security Settings - then set the same private key as before, and
    2) Edit>Protection>Manage Trusted Identities - then set the same public keys as before.
    It should have worked, right?

  • I'm trying to timestamp (RFC 3161) a pdf using my own timestamp server hardware but always get an error: "Certificate invalid for use" ...

    I'm trying to timestamp (RFC 3161) a pdf using my own timestamp server hardware but always get an error: "Certificate invalid for use" (Original text - pt_BR:O certificado não é válido para uso). How can I get more info on what I'm missing or whats wrong with the certificate?

    Which Acrobat version are you using? Do you use "Document Timestamp" command? If so, do you get this error during the signing process and the signature is not created or signature is created and you get this error when it is validated? If the latter you can open signature properties, click on the "Advanced Properties" and in the next dialog on timestamp's "Show Certificate". If you get this error during the signing process do you get an alert that shows some cryptic info with a number? If you do provide the content of this alert.
    Also which Acrobat version (including minor) are you using?

  • Unlocking secure PDFs on the Microsoft surface RT

    I recently bought a Windows Surface RT and the adobe application from the market place does not let me unlock secure PDF. I am currently attending the University of Phoenix and all of our text books are Apollo E-Books that are secured by protectedpdf password management. I was wondering if there will be patches for the windows RT platform that will fix this issue? If these patches are expected to occur, in what time frame wold I be looking at?

    If you had an Intel-based desktop machine, laptop, or tablet, you could install Adobe Reader XI (desktop app with the traditional Windows UI) and open the DRM-protected PDF documents from University of Phoenix.
    http://www.universityofphoenix.com/ebooks/ppdf.asp
    Unfortunately, Adobe Reader XI does not run on Microsoft Surface with Windows RT.  (More Intel-based tablets from Microsoft, Samsung, HP, Dell, etc. running Windows 8 will be released this year.)  Currently, Adobe Reader for mobile devices (iOS, Android, and Windows tablets) cannot open the DRM-protected PDF documents from University of Phoenix using the third-party technology called Vitrium's Protectedpdf due to the lack of full JavaScript support.

  • Generating PDF using toolbar script

    Hi All,
    I am trying to create a PDF using a toolbar script and iText libraries.
    I need to convert an MSA to a PDF.
    What I want to know is that after the PDF is created, how can I auto open it in IE without human intervention.
    Any pointers shall be highly appreciated.
    Regards,
    Himanshu

    Hello,Expert,
    we tried creating the PDF using the following script, and got an error. Could you please give me some adviece about it!!
    Many thinks..
    the Script is:
    para = new Paragraph("asdsadsdsadsadas");
    Document doc1 = new Document();
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    PdfWriter.getInstance(doc1,bos);
    doc1.open();
    doc1.add(para );
    doc1.close();
    FileInputStream nos = new FileInputStream(bos);
    //newAttachment = TypeFactory.createAttachment();
    //newAttachment.setFileData("Vendor Admit Certificate",nos,doc,session);
    The Error Message is:
    Typed variable declaration : Constructor error: Can't find constructor:
    java.io.FileInputStream( java.io.ByteArrayOutputStream ) in class: java.io.FileInputStream

  • Programmatically encrypt PDF using User Certifcate

    Hi all,
    I would like to programmatically encrypt a pdf using a user certificate (.cer), where the user certificate is stored in a specified directory. Is there a way to do it using vb.net? I had a look at the the acrobat sdk, but couldn't find relevant coding samples to perform the above.
    Please help.
    Thanks.
    Jess

    I now try to write the pass the AcroJS script in my vb.net code through the addScript function of the JSObject:
    Dim jso As Object = pdDoc.GetJSObject
    Dim JSScript As String = "security.getHandler(""Adobe.PPKMS"", true); "
    jso.addScript("Test", JSScript)
    However, it gave an error when i tried to execute the getHandler function. I tried putting the code directly into Acrobat as well and that didn't work either.
    Am I missing something? Please help.
    Thanks.
    Jess

  • Why unable to sign PDF with certificate after applying Nitro PDF password protection? (despite it explicitly allowing signing with certificates)

    I used Adobe Reader XI to sign PDFs with certificate, which worked perfectly. Except that the PDF could still be edited by other programs (for example, Nitro PDF) after the signing (but not the fill out fields and the signature). To apply password protection makes sense to avoid changes in the PDF being made after it has been signed. So I applied password protection via Nitro PDF that allows only enter fill-out fields and signing. But when I open it with Adobe Reader, the filling out works fine, but the signing part is not available to click on it (all of the buttons under "Sign" tab are grey). When I go on the Security properties with Adobe Reader, I can explicitly see that signing of this PDF is allowed and yet the option is not open to use for me anymore.
    Any ideas on why it is the case and what I could do about that?
    Many thanks!
    O.

    Actually yes, I just asked my colleague to assist me with this, he password-protected the PDF with Acrobat 8, explicitly allowing for signing and fill-out functions, it also appears in Adobe Reader under security properties as "allowed", but it is not open to use in the Reader for me anymore (grey buttons).

  • Sign a pdf using usb token

    I am using below code to sign a pdf using itextsharp version 5.5.1.0 . It works fine. But itextsharp 5.5.1.0
    is having AGPL and i think it cannot be used in my application freely. But by using version below 4.1.6 which has GPL licence the same code does not work. So is there any alternative?
    using System;
    using System.Windows.Forms;
    using System.IO;
    using System.Security;
    using System.Security.Cryptography;
    using System.Security.Cryptography.X509Certificates;
    using iTextSharp.text.pdf;
    using iTextSharp.text.pdf.security;
    namespace SignPdf
    public partial class Form1 : Form
    public Form1()
    InitializeComponent();
    private SecureString GetSecurePin(string PinCode)
    SecureString pwd = new SecureString();
    foreach (var c in PinCode.ToCharArray()) pwd.AppendChar(c);
    return pwd;
    private void SignWithThisCert(X509Certificate2 cert)
    string SourcePdfFileName = textBox1.Text;
    string DestPdfFileName = textBox1.Text + "-Signed.pdf";
    Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser();
    Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509.X509Certificate[] { cp.ReadCertificate(cert.RawData) };
    IExternalSignature externalSignature = new X509Certificate2Signature(cert, "SHA-1");
    PdfReader pdfReader = new PdfReader(SourcePdfFileName);
    FileStream signedPdf = new FileStream(DestPdfFileName, FileMode.Create); //the output pdf file
    PdfStamper pdfStamper = PdfStamper.CreateSignature(pdfReader, signedPdf, '\0');
    PdfSignatureAppearance signatureAppearance = pdfStamper.SignatureAppearance;
    //here set signatureAppearance at your will
    signatureAppearance.Reason = "Because I can";
    signatureAppearance.Location = "My location";
    signatureAppearance.SignatureRenderingMode = PdfSignatureAppearance.RenderingMode.DESCRIPTION;
    MakeSignature.SignDetached(signatureAppearance, externalSignature, chain, null, null, null, 0, CryptoStandard.CMS);
    //MakeSignature.SignDetached(signatureAppearance, externalSignature, chain, null, null, null, 0, CryptoStandard.CADES);
    MessageBox.Show("Done");
    private void Form1_Load(object sender, EventArgs e)
    private void button1_Click_1(object sender, EventArgs e)
    //Sign with certificate selection in the windows certificate store
    X509Store store = new X509Store(StoreLocation.CurrentUser);
    store.Open(OpenFlags.ReadOnly);
    X509Certificate2 cert = null;
    //manually chose the certificate in the store
    X509Certificate2Collection sel = X509Certificate2UI.SelectFromCollection(store.Certificates, null, null, X509SelectionFlag.SingleSelection);
    if (sel.Count > 0)
    cert = sel[0];
    else
    MessageBox.Show("Certificate not found");
    return;
    SignWithThisCert(cert);

    hi.
    you may return to the iTextshap version to 5.3.3, it works fine to sign a PDF using external USB token.
    free C#
    Excel  component being evaluated, any other recommendation is appreciated.
    Thanks and Regards.
    But version 5.3.3 is also having AGPL licence, As i said in question
    version below 4.1.6 has GPL licence.

  • 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

  • Convert smartform output in to PDF using CONVERT_OTF function  how to do it

    Hi Anil , and  Hi All
             I am trying to display smartforms output in java webdynpro
             for that i have got the following code in sdn.
               can anybody please clarify these doubts in the  below code
               1) What are the mandatory input and output parameters
                   I have to pass here in this code to my application
               2) please check my previous post also in this regards please
       . Please reply at the very earliest. Check the below code
    Convert smartform output in to PDF using CONVERT_OTF function module and you can write pdf using parameter 'binfile' of this function in WebDynpro using the following code:
    It is copied from my prg. I hope you understand it.
    public void onActionGetQuote(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionGetQuote(ServerEvent)
    wdThis.wdGetOppt_QwriterCustController().executeZquote_Writer_Input();
    String fileName = wdContext.currentZquote_Writer_InputElement().getOrder().toString().trim() + System.currentTimeMillis() + ".pdf";
    String pdfOutput = new String(wdContext.currentOutputElement().getBinfile());
    if (pdfOutput != null)
    try
    String pdfResoucePath = WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(), fileName);
    FileOutputStream fileOutputStream = new FileOutputStream(new File(pdfResoucePath));
    PrintStream ps = new PrintStream(fileOutputStream);
    ps.print(pdfOutput);
    ps.close();
    //Display the PDF to the browser
    String fileURL = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(), fileName);
    IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(fileURL, "Pdf Browser", false);
    window.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
    window.removeWindowFeature(WDWindowFeature.MENU_BAR);
    window.removeWindowFeature(WDWindowFeature.STATUS_BAR);
    window.removeWindowFeature(WDWindowFeature.TOOL_BAR);
    window.open();
    // To collect all the file created in the server by user
    quoteFiles.add(quoteFiles.size(), pdfResoucePath);
    } catch (Exception e)
    throw new WDRuntimeException(e);
    //@@end

    Hi
        ABAPers prepared a BAPI function module which calls Smart form , how can i execute it from java Webdynpro, so that I can display the smart form in Webdynpro. Pleas reply at the very earliest.  Every answer will be rewarded.
    regards
    jalandhar

  • Print to PDF - using Snow Leopard (Saving a PDF file when printing is not supported. Instead, choose

    i have a PDF form that i created that is used as a custom proposal that my company sends out to potential clients. the form in its editable state is only used internally. we recently upgraded to snow leopard, but prior to the upgrade, we were able to fill the custom proposal form out using adobe reader, and, as you well know, we weren't able to save that edited document as a PDF with the custom form fields filled out. our work around using adobe reader was to print to a pdf using the adobe pdf printer in the printer dialog. with the addition of snow leopard, however, instead of choosing the adobe pdf printer, we were to choose PDF from the bottom left corner, then Save As PDF, and it would spit out an uneditable pdf that then allowed us to email it to the potential client without them being able to edit it as well as have an internal, digital copy for our records instead of having lots of paper floating around (i know this is also doable using security that disallows the client certain editing privileges, but printing to a pdf is much quicker and more efficient, and the pdf security isn't really that secure at its best).
    in any case, i came across this gem of a post here on the support forums that installs another option from the PDF drop down on the bottom left of the print dialog menu that reads Save As Adobe PDF and is supposed to do exactly what i am trying to get it to do...print to a pdf file from adobe reader.
    http://kb2.adobe.com/cps/509/cpsid_50981.html    
    once i updated to acrobat 9.2 (as the link above suggests 9.1), however, the Save As Adobe PDF does appear in the print dialog menu, but it still gives me the same error that acrobat 8 - 9 gave me while using Snow Leopard — Saving a PDF file when printing is not supported. Instead, choose File > Save — and as i've already explained, you can't save an edited pdf form in reader (as i am the only one in the office with acrobat) and still keep the fields as you've entered them in. the only work around is to print to a pdf but is apparently having some recent problems.
    using acrobat, however, i know that i can save the editable pdf as a new file with the fields customized as i have left them, but it still saves it as an editable pdf and the print to a pdf option still remains the best option...that way we have digital copies internally that are uneditable that can be printed at any time or emailed to the client.
    how can i do print to a pdf, based on what i've written above, using snow leopard and acrobat and reader?

    A simple way is to flatten the form fields, which converts the field appearances to regular page contents. You can do this with JavaScript or PDF Optimizer (Advanced > PDF Optimizer > Discard Objects > Flatten form fields). A very nice script that adds a custom menu item can be found here: http://www.uvsar.com/projects/acrobat/flattener/

  • How to get page number from the PDF using Javascript

    Hi,
    We are having list of Single page PDF. The pdf are named in the order,
    ISBN_Author_01.PDF  (with real page number as i)
    ISBN_Author_02.PDF  (with real page number as ii)
    ISBN_Author_03.PDF  (with real page number as iii)
    ISBN_Author_04.PDF  (with real page number as 1)
    ISBN_Author_05.PDF  (with real page number as 2)
    ISBN_Author_06.PDF  (with real page number as 3)
    ISBN_Author_nn.PDF  (with real page number as 500)
    Here each pdf has a page number and in sequential order.
    The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
    To do this task, I am writing a Javascript to get the real page number from the PDF.
    Can anybody help me how to get the page number from the PDF using Javascript.
    Thanks,
    Gopal

    The "real" page number within a PDF is the count of the physical page starting at 0, zero.
    pageNum numPages
    The number printed on each page is the page label.
    setPageLabels  getPageLabel
    You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional  array of the file names and the page label for the page within that array.

  • What happens to attachment in a PO when it is converted to PDF using SPOOL.

    Hi Experts,
    While converting a PO to PDF using a spool number, it works fine but i have a question as If the PO has an attachment, does the spool take care of that also?
    If not how to download the attachment as well.
    Thanks & Regards,
    K

    Hi Shan,
    No in ME21N there is a tab called Attachment, by which we can attach a note or something(I am thou not sure why this is done), yes a script is generated into a PDF but this attachment which is part of PO does it get attached or we need to do somthing to attach it to PDF was my question?
    Cheers,
    K
    Edited by: Ken Thompson on Sep 29, 2008 5:58 AM

  • How to repeat table header on each page of PDF using Coldfusion

    Hi all,
    Can anybody help me in resolving this issue. The details are mentioned below.
    I am generating PDF using <cfdocument> tag of Cold Fusion.
    I have a header and footer to be displayed on each page. I am rendering data in a table.
    If rows in the table exceed a page , and continue on the next page , I want the table headers to be repeated on each of the page.
    Example :
    Currently this is happening:
    Page Header
    Sr No
    Name
    Occupation
    1
    A
    A
    2
    B
    B
    3
    C
    C
    Page Footer : Page No 1
    Page Header
    4
    A
    A
    5
    B
    B
    6
    C
    C
    Page Footer : Page No 2
    What I want is :
    Page Header
    Sr No
    Name
    Occupation
    1
    A
    A
    2
    B
    B
    3
    C
    C
    Page Footer : Page No 1
    Page header
    Sr No
    Name
    Occupation
    4
    A
    A
    5
    B
    B
    6
    C
    C
    Page Footer : Page No 2

    Hi Dan ,
    Thanks for your inputs.
    This way wont work beacause , am displaying other text and table both, and the table will be diplayed based on some conditions. If the conditions are true , table will be diplayed , else not.
    I missed to illustrate text in the example. The scenario is something like this :
    Page Header
    Text .........
    Table [Displayed conditionaly]
    Page Footer
    Please suggest me some way to do this.

  • When i try to open a pdf using int exp i get a message that it has encountered a problem and will cl

    when i try to open a pdf using int exp i get a message that it has encountered a problem and will close

    Internet explorer.  I have adobe reader and flash player which I uninstalled and reinstalled.  I tried another browser and the pdf's open so it is a problem with IE .Thanks for your comments.
    [private data removed]

Maybe you are looking for