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
精彩评论