在 Salesforce 中保存哈希字符串?
不是 SFDC 专家,但需要集成 SFDC 中托管的 Web 表单。由于其他原因,此页面需要捕获初始密码并将该密码的 salted/sha256 版本发送给另一个系统或人员。我显然不想保存明文。
在保存之前对密码进行哈希处理的最简单的方法是什么?我可以在浏览器中执行此操作,但我不想依赖 Javascript。
Not a SFDC expert but need to integrate a web form hosted in SFDC. For other reasons, this page needs to capture an initial password and send off the salted/sha256'd version of the password to another system or a human. I don't want to save the cleartext obviously.
What's the lightest touch way to hash the password before saving? I could do this in the browser except that I don't want to rely on Javascript.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,您应该将此代码添加到 apex 触发器中。
Yes, you should add this code to an apex trigger.
以下是将字符串加密为 SHA256 哈希格式的代码:
或者在字段值的情况下
Here is the code to encrypt a string to SHA256 hash format :
or in case of field value
Apex 有一个
Crypto
类,其中包含您需要的generateDigest
方法,如下所示:Apex has a
Crypto
class which has agenerateDigest
method you need, something like:这对我有用=>
This worked for me =>