Esempio n. 1
0
 def deregister_acme_account(self):
     regr = RegistrationResource.from_json(json.loads(
         self.account.contents))
     updated_regr = self.client.deactivate_registration(regr)
     if updated_regr.body.status == 'deactivated':
         return True
     return False
Esempio n. 2
0
    def __init__(self, account_id=None):
        if account_id:
            self.account = Account.query.get(account_id)

            self.key = jose.JWKRSA(
                key=crypto.load_private_key(self.account.key.encode("utf8")))

            regr = RegistrationResource.from_json(
                json.loads(self.account.contents))
            net = ClientNetwork(self.key, account=regr)
            self.client = BackwardsCompatibleClientV2(
                net, self.key, self.account.directory_uri)
        else:
            print("Setup ACME Account")