def delete(self): """ Remove any keys for this address. """ gpg = get_gpg() for key in gpg.list_keys(): if self.address in addresses_for_key(gpg, key): gpg.delete_keys(key["fingerprint"], True) gpg.delete_keys(key["fingerprint"]) super(Address, self).delete()
def delete(self): """ Remove any keys for this address. """ gpg = get_gpg() for key in gpg.list_keys(): if self.address in addresses_for_key(gpg, key): gpg.delete_keys(key["fingerprint"], secret=True, passphrase=SIGNING_KEY_PASSPHRASE) gpg.delete_keys(key["fingerprint"]) super(Address, self).delete()
def save(self, *args, **kwargs): gpg = get_gpg() result = gpg.import_keys(self.key) addresses = [] for key in result.results: addresses.extend(addresses_for_key(gpg, key)) self.fingerprint = result.fingerprints[0] super(Key, self).save(*args, **kwargs) for address in addresses: address, _ = Address.objects.get_or_create(key=self, address=address) address.use_asc = self.use_asc address.save()