Creating a data page activity for a keystore

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.