开发者

Digital signature in PHP

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜