'Create or update an account on the ACME server. As the only way
(without knowing an account URI) to test if an account exists
is to try and create one with the provided account key, this
method will always result in an account being present (except
on error situations). If the account already exists, it will
update the contact information.
https://tools.ietf.org/html/draft-ietf-acme-acme-02#section-6.3'

def init_account(self):

    contact = []
    if self.email:
        contact.append(('mailto:' + self.email))
    if (not self._new_reg(contact)):
        (result, _) = self.send_signed_request(self.uri, {'resource': 'reg'})
        if ('authorizations' in result):
            self._authz_list_uri = result['authorizations']
        if ('certificates' in result):
            self._certs_list_uri = result['certificates']
        do_update = False
        if ('contact' in result):
            if (cmp(contact, result['contact']) != 0):
                do_update = True
        elif (len(contact) > 0):
            do_update = True
        if do_update:
            upd_reg = result
            upd_reg['contact'] = contact
            (result, _) = self.send_signed_request(self.uri, upd_reg)
            self.changed = True
