fd4ad9bd2e
This commit removes duplication, tidies up a couple of things and puts some common code into the x509 module.