Digitally Signed in PHP

Can someone explain how to implement "digital signature" in PHP. I tried very hard to find the answer myself, but so far have not had much success.

+4
source share
1 answer

I will give you a formal answer, since you have an overly nonspecific request:

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

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

+2
source

Source: https://habr.com/ru/post/1343690/


All Articles