Expand my Community achievements bar.

Unlock Encypted PDF Using certificates

Avatar

Level 2

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 v...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

1 Reply

Avatar

Level 2

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