Accessing Keystore information through Java
Hi all.
Due to our client's requirement, we need to access their digital certificate to digitally sign a document using custom Java code. In order to achieve that, we have created a Keystore rule where the certificate (PKCS12) is located and where the client inputs the password. We need to retrieve the keystore filepath and its password in the Java code to be able to use the library that extracts the information from the certificate and signs the document.
Has anyone encountered a similar situation and knows how to address this issue? We have tried several approaches but none have worked so far.
Thanks,
Álvaro
@AlvaroA
Create a Keystore Rule in Pega:
Add PDFBox Library:
Write Java Code to Access Keystore:
@AlvaroA
Create a Keystore Rule in Pega:
Add PDFBox Library:
Write Java Code to Access Keystore:
Retrieve Keystore Filepath and Password:
Handle Exceptions:
Example Usage in Pega Activity
Create a Custom Activity:
KeystoreUtilclass.Set Parameters:
Call the Java Code:
KeystoreUtilclass to load the keystore and retrieve the certificate and private key.