public static void setupPropertyEncryptionKey(String key) {
        // Get the old secret key and encryption type
        String oldAlg = securityProperties.getProperty(ENCRYPTION_ALGORITHM);
        String oldKey = getCurrentKey();
        if ((StringUtils.isNotEmpty(oldKey) || propertyEncryptor != null) && StringUtils.isNotEmpty(key) && !key.equals(oldKey) && StringUtils.isNotEmpty(oldAlg)) {
            // update encrypted properties
            updateEncryptionProperties(oldAlg, key);
        }
        // Set the new key
        securityProperties.setProperty(ENCRYPTION_KEY_CURRENT, new AesEncryptor().encrypt(key));
        currentKey = key == "" ? null : key;
        propertyEncryptorNew = getEncryptor(oldAlg, key);
        propertyEncryptor = propertyEncryptorNew;
    }
This method is called early during the setup process to
set a custom key for encrypting property values
@param key the key used to encrypt properties
xmppserver/src/main/java/org/jivesoftware/util/JiveGlobals.java