0
import gnupg, urllib
retk = urllib.urlopen("http://keyserver.pramberger.at/pks/"
"lookup?op=get&search=userid for the key is required")
pub_key = retk.read()
#print pub_key
gpg = gnupg.GPG(gnupghome="/tmp/foldername", verbose=True)
print "Import the Key :", gpg.import_keys(pub_key).summary()
print "Encrypt the Message:"
msg = "Hellllllllllo"
uid = "userid that has the key on public key server"
enc = gpg.encrypt(msg, uid,always_trust=True)
print "*The enc content***************************== ", enc
用python编写的这个函数给了我加密的消息。加密是使用我从公钥服务器(pramberger.at)获得的公钥完成的。加密解密功能在php
现在我怎么能在php中实现相同的功能(从任何公钥服务器获取密钥并使用该密钥加密消息)。