- 如何使用PHP或openssl从Salesforce Self Signed证书导出私钥？
I created a Self-Signed cert by following this article I set the private key as exportable but there isn't an export link within the salesforce app (that I can see) so I'm guessing you have to export from the certificate itself. I'm using the PHP openssl x509 functions but i can't get it to work. I keep getting
openssl_sign(): supplied key param cannot be coerced into a private key...when I run this code:
... $private_key = openssl_get_privatekey(file_get_contents(env('SALESFORCE_CERT_FILE'))); $s = ""; openssl_sign($header . '.' . $payload, $s, $private_key, "SHA256"); ...
I figured it out. In salesforce they do have an "export" button that says "Export to Keystore". I was unfamiliar with this so I didn't think to use it. I was looking for export private key or something like that. Turns out you can just following the answer to this stack exchange question to get your private key.
我弄清楚了。 在salesforce中，他们有一个“导出”按钮，上面写着“导出到密钥库”。 我不熟悉这个，所以我没想到要用它。 我一直在寻找出口私钥或类似的东西。 事实证明你可以按照这个答案堆栈交换问题以获取您的私钥。</ p>