Could someone please explain how to implement a "digital signature" in 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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.