加密密码
有关详细信息,请参阅此帮助中心中的主题ThingWorx 帮助中心中的 安全管理工具
加密许可证和数据库密码 (8.4.0+)
KeyStore 提供程序使用加密存储在文件中的安全令牌来使用 KeyStore。写入 KeyStore 的所有数据都将通过密码进行安全存储。第一次启动此提供程序时,将生成随机密码值和 KeyStore 文件 (若尚未存在)。
* 
KeyStore 密码和 KeyStore 文件应仅限于应用程序用户使用。应用程序用户必须具有该文件的读取/写入权限。
* 
以下是基于 Windows 的示例。如果您使用的是基于 Linux 的操作系统,请根据需要更改命令。
要预创建 KeyStore 文件并在其中存储初始数据,您必须使用安全管理工具 安全管理工具
1. PTC 支持站点获取 Security Management Tool 压缩文件。
2. 将 ZIP 文件中的内容解压缩至某一目录。
3. 通过以下参数创建配置文件,并将其置于解压缩文件的 bin 文件夹中。
* 
在本示例中,该文件的文件名为 keystore.conf,该工具的版本为 1.0.0.36,其位于 C://security-common-cli-1.0.0.36/bin
* 
default-encryption-key-length 必须同应用程序配置相匹配。在 ThingWorx 中,它是位于 platform-settings.json 中的 InternalAesCryptographicKeyLength 参数。默认值为 128,但如果您使用的是 Java 1.8.0_162 或更高版本,则可使用 256 位加密。如有必要,您还可以通过更新密钥大小限制的 Java 策略来使用较旧的 Java 版本。
{
security {
secret-provider = "com.thingworx.security.provider.keystore.KeyStoreProvider"
default-encryption-key-length = 128
keystore {
password-file-path = "/ThingworxPlatform"
password-file-name = "keystore-password"
path = "/ThingworxStorage"
name = "keystore"
}
}
}
4. 启动命令提示符并转至 security-common-cli-1.0.0.36\bin 位置。
5. 运行下列命令以在所配置位置创建密码文件和 KeyStore:
许可证密码:
C:\security-common-cli-1.0.0.36\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.licensing.password "add-password-here"
数据库密码:
C:\security-common-cli-1.0.0.36\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.db.password "add-password-here"
许可证代理密码:
C:\security-common-cli-1.0.0.36\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.proxy.password "add-password-here"
RabbitMQ 密码 (如果已安装 ThingWorx Flow):
C:\security-common-cli-1.0.3.48\bin> security-common-cli.bat <path to keystore>\keystore.conf
set encrypt.queue.password "add-password-here"
6. 打开 ThingworxPlatform\platform-settings.json 并进行以下更新:
许可证密码:在 LicensingConnectionSettings 下,将 password 值更改为 encrypt.licensing.password。例如,"password": "encrypt.licensing.password"
数据库密码:在您使用的持久化方案提供工具的 PersistenceProviderPackageConfigs ConnectionInformation 下,将 password 值更改为 encrypt.db.password。例如,"password": "encrypt.db.password"
许可证代理密码:在 LicensingConnectionSettings 下,将 password 值更改为 encrypt.proxy.password。例如,"password": "encrypt.proxy.password"
RabbitMQ 密码 (如果已安装 ThingWorx Flow):在 platform-settings.json 文件的 OrchestrationSettings 下,将 QueuePassword 值更改为 encrypt.queue.password。例如,"QueuePassword": "encrypt.queue.password"
当遇到加密密码时,此密码会提示 ThingWorx 平台在密钥库中查找该密码。
加密许可证和数据库密码 (8.3.x 及以下版本)
有关此过程的详细信息,请参阅旧版 安装指南