Much nicer looking code if we can use gpglib