Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Functions
commands.public_key_operations Namespace Reference

Functions

None public_key_information (SigningKey key, Optional[str] public_key_file, Optional[str] evidence_file)
 

Function Documentation

◆ public_key_information()

None commands.public_key_operations.public_key_information ( SigningKey  key,
Optional[str]  public_key_file,
Optional[str]  evidence_file 
)
Print (and optionally save) public information about a private key.

Definition at line 19 of file public_key_operations.py.

20  key: SigningKey,
21  public_key_file: Optional[str],
22  evidence_file: Optional[str]) -> None:
23  """
24  Print (and optionally save) public information about a private key.
25  """
26 
27  if public_key_file and exists(public_key_file):
28  raise Exception("public key file already exists")
29  if evidence_file and exists(evidence_file):
30  raise Exception("evidence file already exists")
31 
32  pub_key = get_verification_key(key)
33  key_evidence = create_key_evidence(key)
34  pub_key_str = export_verification_key(pub_key)
35  evidence_str = export_signature(key_evidence)
36 
37  if public_key_file:
38  with open(public_key_file, "w") as pk_f:
39  pk_f.write(pub_key_str)
40  if evidence_file:
41  with open(evidence_file, "w") as ev_f:
42  ev_f.write(evidence_str)
43 
44  print("Public Verification Key:")
45  print(pub_key_str)
46  print("\nKey Evidence:")
47  print(evidence_str)
Here is the call graph for this function:
coordinator.crypto.export_signature
str export_signature(bytes sig)
Definition: crypto.py:74
coordinator.crypto.export_verification_key
str export_verification_key(ecdsa.VerifyingKey vk)
Definition: crypto.py:66
zeth.cli.zeth_get_verification_key.get_verification_key
None get_verification_key(Context ctx, Optional[str] vk_out)
Definition: zeth_get_verification_key.py:15
commands.public_key_operations.public_key_information
None public_key_information(SigningKey key, Optional[str] public_key_file, Optional[str] evidence_file)
Definition: public_key_operations.py:19
coordinator.crypto.create_key_evidence
Signature create_key_evidence(ecdsa.SigningKey key)
Definition: crypto.py:103