<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def createRootCertificate(self, noPass = False, keyLength = 4096):
 """Create a root certificate """

        configPath, keyPath, certPath = \
                os.path.join(self.basePath, self.FILE_CONFIG), \
                os.path.join(self.basePath, self.DIR_PRIVATE, self.FILE_CA_KEY), \
                os.path.join(self.basePath, self.DIR_CERTS, self.FILE_CA_CERT)
        if os.path.isfile(keyPath):
            raise ValueError('CA key file exists at [%s]' % keyPath)
        if os.path.isfile(certPath):
            raise ValueError('CA certificate file exists at [%s]' % certPath)
        # Generate the key
        if subprocess.call([ 'openssl', 'genrsa', '-aes256', '-out', keyPath, str(keyLength) ] if not noPass else [ 'openssl', 'genrsa', '-out', keyPath, str(keyLength) ]) != 0:
            raise ValueError('Failed to create root key')
        # Generate the cert
        if subprocess.call([ 'openssl', 'req', '-config', configPath, '-key', keyPath, '-new', '-x509', '-days', '7300', '-sha256', '-extensions', 'v3_ca', '-out', certPath ]) != 0:
            raise ValueError('Failed to create root certifcate')