diff --git a/nucypher/characters/lawful.py b/nucypher/characters/lawful.py index 8b6399c3a..23ce37d69 100644 --- a/nucypher/characters/lawful.py +++ b/nucypher/characters/lawful.py @@ -181,6 +181,11 @@ class Alice(Character, BlockchainPolicyAuthor): self.active_policies = dict() self.revocation_kits = dict() + def get_card(self) -> 'Card': + from nucypher.policy.collections import Card + card = Card.from_character(self) + return card + def add_active_policy(self, active_policy): """ Adds a Policy object that is active on the NuCypher network to Alice's diff --git a/nucypher/policy/collections.py b/nucypher/policy/collections.py index 3ca6f405d..224d2dbb8 100644 --- a/nucypher/policy/collections.py +++ b/nucypher/policy/collections.py @@ -450,8 +450,14 @@ class Card: return cls.from_bytes(base64.urlsafe_b64decode(b64data)) def to_qr_code(self): + import qrcode from qrcode.main import QRCode - qr = QRCode() + qr = QRCode( + version=1, + box_size=1, + border=4, # min spec is 4 + error_correction=qrcode.constants.ERROR_CORRECT_L, + ) qr.add_data(bytes(self)) qr.print_ascii()