سؤال

The php.net website contains information on how to encrypt the information with its own key.

$gpg = new gnupg();
$gpg -> addencryptkey("8660281B6051D071D94B5B230549F9DC851566DC");
$enc = $gpg -> encrypt("just a test");
echo $enc;

But if I wanted to encrypt a message having only the public key of the recipient of the message?

How is this possible?

هل كانت مفيدة؟

المحلول

Looks like you should first add the public key to GnuPG keyrings, and after that call addencryptkey() with that key's fingerprint.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top