Validate the PEM encoded x509 user certificate bytes and return it.

        Args:
            byts (bytes): The bytes for the User Certificate.
            cacerts (tuple): A tuple of OpenSSL.crypto.X509 CA Certificates.

        Raises:
            OpenSSL.crypto.X509StoreContextError: If the certificate is not valid.

        Returns:
            OpenSSL.crypto.X509: The certificate, if it is valid.

def valUserCert(self, byts, cacerts=None):
        '''
        Validate the PEM encoded x509 user certificate bytes and return it.

        Args:
            byts (bytes): The bytes for the User Certificate.
            cacerts (tuple): A tuple of OpenSSL.crypto.X509 CA Certificates.

        Raises:
            OpenSSL.crypto.X509StoreContextError: If the certificate is not valid.

        Returns:
            OpenSSL.crypto.X509: The certificate, if it is valid.

        '''
        cert = crypto.load_certificate(crypto.FILETYPE_PEM, byts)

        if cacerts is None:
            cacerts = self.getCaCerts()

        store = crypto.X509Store()
        [store.add_cert(cacert) for cacert in cacerts]

        ctx = crypto.X509StoreContext(store, cert)
        ctx.verify_certificate()  # raises X509StoreContextError if unable to verify
        return cert