Expand my Community achievements bar.

does LiveCycle Digital Signatures support unicode pkcs #12 file?

Avatar

Level 2

I used Adobe Acrobat and OpenSSL to generated a unicode pkcs#12 file. Import to the Windows are all correct. But when I used for LiveCycle Digital Signatures, after signed, the one use Acrobat generated pkcs12 file signed only can show ASCII character,and other one used OpenSSL pkcs12 file to signed,signature character changed to  irrecognizable.

11 Replies

Avatar

Former Community Member

LiveCycle Digital Signatures ES does support the use of PKCS#12 (.p12, .pfx) X509 compliant files for the creation of a digital signature.  There is most likely something wrong with the certificate that you created, can you post it for testing (along with the password)?

Thanks

Steve

Avatar

Level 2

These are two unicode pkcs #12 files. one created by openssl, another one created by Acrobat.

I used this code to sign to the PDF file.

        try    {
            // This example will upload an XDP file to the LiveCycle Repository
            ServiceClientFactory myFactory = ServiceClientFactory.createInstance(LCCommonUtil.getConnectionProps());

            // Create a SignatureServiceClient object
            SignatureServiceClient signClient = new SignatureServiceClient(myFactory);

            // Specify a PDF document to sign
            FileInputStream fileInputStream = new FileInputStream(
                    "C:\\Applications\\pdfForms\\TestDigitalSign\\ConferenceReg_flatten_sf_added.pdf");

            Document credDoc = new Document(fileInputStream);

            // Specify the name of the signature field
            String fieldName = "SignatureField1";

            //
            // Create a Credential object
            //
            Credential myCred = Credential.getInstance("BLC_CHINA"); // LC Server: Local Credentials
             System.out.println("******"+myCred.getSpiName());
            // Specify the reason to sign the document
            String reason = "The document was reviewed";

            // Specify the location of the signer
            String location = "New York HQ";

            // Specify contact information
            String contactInfo = "Tony Blue";

            // Create a PDFSignatureAppearanceOptions object and show date information
            PDFSignatureAppearanceOptionSpec appear = new PDFSignatureAppearanceOptionSpec();
            appear.setShowDate(true);
            appear.setShowReason(true);

            // Set revocation checking to false
            java.lang.Boolean revCheck = new Boolean(false);

            // Create objects to pass to the sign method
            OCSPOptionSpec ocspSpec = new OCSPOptionSpec();
            CRLOptionSpec crlSpec = new CRLOptionSpec();
            TSPOptionSpec tspSpec = new TSPOptionSpec();

            // Sign the PDF document
            Document signedDoc = signClient.sign(
                credDoc,
                fieldName,
                myCred,
                HashAlgorithm.SHA1,
                reason,
                location,
                contactInfo,
                appear,
                revCheck,
                ocspSpec,
                crlSpec,
                tspSpec);

            // Save the signed PDF document
            File outFile = new File("C:\\ConferenceReg_flatten_signed.pdf");

            signedDoc.copyToFile(outFile);
        }
        catch (Exception ee) {
            ee.printStackTrace();
        }

Avatar

Level 2

checked attachment for unicode p12 files. the password is : password

please change the .txt extension from the file name.

Thanks

Avatar

Former Community Member

Thanks

I was able to install the "Acrobat.pfx" (use "password" as the password), but the "Openssl.p12" file does not seem to use "password" as the password.  What is the password got the openssl.p12 file?

Regards

Steve

Avatar

Level 2

I am sorry. the openssl.p12 file password is : blc123

Avatar

Former Community Member

Well, the problem is definately due to the digital certificate.  I was able to sign a PDF using LiveCycle Digital Signatures ES with the Acrobat created certificate.  When I tried the sign a PDF with the Open SSL certificate LC threw an error.

If you compare the certificates (see attached - rename with .cer extension) , there are a few differences, unfortunately I don't know which "difference" is responsible for the problem.  The Openssl certificate contains some double-byte characters (Issuer and Subject attributes)... maybe this is part of the issue?

Hope this helps.

Steve

Avatar

Level 2

Yes. you are right. the OpenSSL certificate contains some double-byte characters( that's why I need use unicode, Cause I want to put Chinese characters into Issuer and Subject attribute) also the acrobat one include both ASCII and Unicode(double-byte Chinese characters), but when you sign it, you only can saw the Digital Signatures only use the ASCII code for sign, not the unicode. That's why I asked if LiveCycle Digital Signatures support unicode pkcs #12 file or not?

Avatar

Former Community Member

I will continue my investigation.  I'll let you know what I turn up as soon as possible.

Regards

Steve

Avatar

Former Community Member

I'm continuing to investigate.  Sorry for the delay.

Regards

Steve