+ searchkey = GPGKeySearch(To);
+ if len(searchkey) == 0:
+ raise Error, "No key found matching %s"%(To);
+ elif len(searchkey) > 1:
+ raise Error, "Multiple keys found matching %s"%(To);
+ if searchkey[0][4].find("E") < 0:
+ raise Error, "Key %s has no encryption capability - are all encryption subkeys expired or revoked? Are there any encryption subkeys?"%(To);
+