Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
php.net 网站包含有关如何使用自己的密钥加密信息的信息。
$gpg = new gnupg(); $gpg -> addencryptkey("8660281B6051D071D94B5B230549F9DC851566DC"); $enc = $gpg -> encrypt("just a test"); echo $enc;
但是,如果我想加密一条只有消息接收者的公钥的消息呢?
这怎么可能?
看起来您应该首先将公钥添加到 GnuPG 密钥环,然后使用该密钥的指纹调用 addencryptkey()。