def trust(nb): """Sign a given notebook object""" notary = NotebookNotary() notary.sign(nb) return nb
def sign (self): notary = Notary () signature=notary.compute_signature (self.notebook) if not signature.startswith ("sha256:"): signature = "sha256:" + signature self.notebook['metadata']['signature'] = signature