Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Creating a data page activity for a keystore

Updated on June 30, 2021

To configure a keystore with a data page reference, you must create the activity that loads the keystore into the data page. You can create the activity by clicking the Add icon on the data page Definition tab.

  1. On the data page Definition tab, next to the Activity name field, click the Add icon.
  2. Enter the label and identifier, accept the default for Apply to class (Data-Admin-Security-Keystore), and then click Create and open.
  3. In the Method field, enter Java.
  4. Click the Expand icon, and then enter the Java Source.
    • To load a JKS or PKCS12 type keystore into the cache, in the Method Parameters section, in the Java Source field, enter a code snippet similar to the following example:
      
                try {
                     java.io.FileInputStream file = new java.io.FileInputStream("
                               JKS_or_PKCS12_keystore_file_with_complete_path");
                     KeyStoreUtils keystoreUtils = pega.getKeyStoreUtils();
                     keystoreUtils.loadKeystore(file);
                } catch(Exception ex){
                     oLog.error("Failed to load keystore into cache "+ex);
      	  }
    • To load a JWK type keystore into the cache, in the Method Parameters section, in the Java Source field, enter a code snippet similar to the following example:
      
                try {               
                    java.net.URL url = new java.net.URL("
                         JWK_keystore_URL_location");           
                    KeyStoreUtils keystoreUtils = pega.getKeyStoreUtils();
                    keystoreUtils.loadKeystore(url.openConnection().getInputStream());
                } catch(Exception ex){
                    oLog.error("Failed to load keystore into cache "+ex);
                }
  5. Click Save.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us