AgeCutOff = 4*24*60*60;
FutureCutOff = 3*24*60*60;
+def ClearKeyrings():
+ del GPGKeyRings[:]
+
# Set the keyrings, the input is a list of keyrings
def SetKeyrings(Rings):
for x in Rings:
# It is best if the recipient is specified using the hex key fingerprint
# of the target, ie 0x64BE1319CCF6D393BF87FF9358A6D4EE
def GPGEncrypt(Message,To,PGP2):
+ Error = "KeyringError"
# Encrypt using the PGP5 block encoding and with the PGP5 option set.
# This will handle either RSA or DSA/DH asymetric keys.
# In PGP2 compatible mode IDEA and rfc1991 encoding are used so that
# A gpg failure is an automatic bad signature
if Exit[1] != 0 and Why == None:
GoodSig = 0;
- Why = "GPG execution failed " + str(Exit[0]);
+ Why = "GPG execution returned non-zero exit status: " + str(Exit[1]);
if GoodSig == 0 and (Why == None or len(Why) == 0):
Why = "Checking Failed";
Res[1].close();
Res[2].close();
+class GPGCheckSig2:
+ def __init__(self, msg):
+ res = GPGCheckSig(msg)
+ self.why = res[0]
+ self.sig_info = res[1]
+ self.key_info = res[2]
+ self.text = res[3]
+
+ self.ok = self.why is None
+
+ self.sig_id = self.sig_info[0]
+ self.sig_date = self.sig_info[1]
+ self.sig_fpr = self.sig_info[2]
+
+ self.key_id = self.key_info[0]
+ self.key_fpr = self.key_info[1]
+ self.key_owner = self.key_info[2]
+
+ self.is_pgp2 = self.key_info[4]
+
# Search for keys given a search pattern. The pattern is passed directly
# to GPG for processing. The result is a list of tuples of the form:
# (KeyID,KeyFinger,Owner,Length)
else:
self.DB[Key] = str(int(Sig[1]));
+# vim:set et:
+# vim:set ts=3:
+# vim:set shiftwidth=3: