'Sign a CertificateRequest instance, returning a Certificate instance.'

def signRequestObject(self, issuerDistinguishedName, requestObject, serialNumber, secondsToExpiry=(((60 * 60) * 24) * 365), digestAlgorithm='sha256'):

    req = requestObject.original
    cert = crypto.X509()
    issuerDistinguishedName._copyInto(cert.get_issuer())
    cert.set_subject(req.get_subject())
    cert.set_pubkey(req.get_pubkey())
    cert.gmtime_adj_notBefore(0)
    cert.gmtime_adj_notAfter(secondsToExpiry)
    cert.set_serial_number(serialNumber)
    cert.sign(self.original, digestAlgorithm)
    return Certificate(cert)
