Skip to main content

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

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Creating a data page activity for a master key from a custom source

Updated on July 1, 2021

To configure a master key keystore with a data page reference to a custom source, create the activity that loads the keystore into the data page.

  1. On the Definition tab of the data page that you are creating the activity for, next to the Activity name field, click the Add icon.
  2. Enter the label and identifier, accept the default for the 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 in the Method Parameters section, in the Java Source field, enter a code snippet similar to one of the following examples, depending on your use case:
    Caution: Do not include both code snippets.
    • To retrieve a master key directly from an external key management service, enter a code snippet similar to this one:
                // Get master key from remote location
                byte[] masterKey = null; // TODO: assign 16 byte master key
                KeyStoreUtils keyUtil = pega.getKeyStoreUtils();
                CustomMasterKey customMasterKey = keyUtil.getMasterKeyObject();
    • To retrieve REST APIs that encrypt and decrypt data keys from an external key management service, enter a code snippet simliar to this one:
                KeyStoreUtils keyUtil = pega.getKeyStoreUtils();
                CustomMasterKey customerMasterKey = keyUtil.getMasterKeyObject();
                //Enable remote encryption mode 
                //If CustomMasterKey object contains Encrypted CDK, then isEncryptedCustomDataKey() method returns true
                    String ecdk =new String(customerMasterKey.getECDK());
                    //oLog.infoForced("decrypting ECDK: ");
                    byte[] cdk = null;// TODO: decrypt the above ecdk at remote KMS and assign it to the cdk variable
                    //CustomMasterKey object contains plaintext CDK
                    byte[] cdk =  customerMasterKey.getCDK();
                    if(cdk!= null){
                        String str = new String(cdk);
                        //oLog.infoForced("encrypting CDK :");
                        byte[] ecdk = null;//TODO: encrypt the above cdk at remote KMS and assign it to the ecdk variable
  5. Click Save.
  • Previous topic Creating a data page for a master key from a custom source
  • Next topic Changing the default keystore caching settings

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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us