def _dump_secrets(storage_index, secret, nodeid, out): from allmydata.util import hashutil from allmydata.util import base32 if secret: crs = hashutil.my_renewal_secret_hash(secret) print(" client renewal secret:", str(base32.b2a(crs), "ascii"), file=out) frs = hashutil.file_renewal_secret_hash(crs, storage_index) print(" file renewal secret:", str(base32.b2a(frs), "ascii"), file=out) if nodeid: renew = hashutil.bucket_renewal_secret_hash(frs, nodeid) print(" lease renewal secret:", str(base32.b2a(renew), "ascii"), file=out) ccs = hashutil.my_cancel_secret_hash(secret) print(" client cancel secret:", str(base32.b2a(ccs), "ascii"), file=out) fcs = hashutil.file_cancel_secret_hash(ccs, storage_index) print(" file cancel secret:", str(base32.b2a(fcs), "ascii"), file=out) if nodeid: cancel = hashutil.bucket_cancel_secret_hash(fcs, nodeid) print(" lease cancel secret:", str(base32.b2a(cancel), "ascii"), file=out)
def _dump_secrets(storage_index, secret, nodeid, out): from allmydata.util import hashutil from allmydata.util import base32 if secret: crs = hashutil.my_renewal_secret_hash(secret) print >>out, " client renewal secret:", base32.b2a(crs) frs = hashutil.file_renewal_secret_hash(crs, storage_index) print >>out, " file renewal secret:", base32.b2a(frs) if nodeid: renew = hashutil.bucket_renewal_secret_hash(frs, nodeid) print >>out, " lease renewal secret:", base32.b2a(renew) ccs = hashutil.my_cancel_secret_hash(secret) print >>out, " client cancel secret:", base32.b2a(ccs) fcs = hashutil.file_cancel_secret_hash(ccs, storage_index) print >>out, " file cancel secret:", base32.b2a(fcs) if nodeid: cancel = hashutil.bucket_cancel_secret_hash(fcs, nodeid) print >>out, " lease cancel secret:", base32.b2a(cancel)
def get_cancel_secret(self): return hashutil.my_cancel_secret_hash(self._lease_secret)