开发者

Digital signature in PHP

开发者 https://www.devze.com 2023-02-16 16:03 出处:网络
Could someone please explain how to implement a \"digital signature\" in 开发者_Go百科PHP. I\'ve tried hard to find an answer myself, but have had little success so far.I\'ll give you a pro-forma answ

Could someone please explain how to implement a "digital signature" in 开发者_Go百科PHP. I've tried hard to find an answer myself, but have had little success so far.


I'll give you a pro-forma answer since you have an overly unspecific inquiry anyway:

file_put_contents("/tmp/document", $text);
exec("gpg --clearsign /tmp/document");
$signed_text = file_get_contents("/tmp/document.asc");

Usually you want to add a --keyring option too. For more complex operations you can use the PHP extension for GPG as shown in this article: http://devzone.zend.com/article/3753

0

精彩评论

暂无评论...
验证码 换一张
取 消