1
- """Python template repository.
2
-
3
- Baseline template for future Python code related to this project.
4
-
5
- Replace this docstring and code below with your own code as required.
6
- """
1
+ """Orcfax simple sign."""
7
2
8
3
import argparse
9
4
import logging
@@ -59,20 +54,20 @@ def signature_in_constitution_config():
59
54
raise NotImplementedError ("reading from config is not yet implemented" )
60
55
61
56
62
- def sign_with_key (data : str , signing_key : str ):
57
+ def sign_with_key (data : str , signing_key : str ) -> str :
63
58
"""Sign with an signing key."""
64
59
skey = pyc .SigningKey .from_json (signing_key )
65
60
vkey = pyc .VerificationKey .from_signing_key (skey )
66
61
logger .info ("signing with addr: %s" , pyc .Address (vkey .hash ()))
67
62
return pyc .sign (data , skey )
68
63
69
64
70
- def signing_handler (data : str , signing_key : str ):
65
+ def signing_handler (data : str , signing_key : str ) -> str :
71
66
"""Handle signing functions."""
72
67
return sign_with_key (data , signing_key )
73
68
74
69
75
- def verify_signature (data : str ):
70
+ def verify_signature (data : str ) -> dict :
76
71
"""Verify a signature with an address."""
77
72
try :
78
73
status = pyc .verify (data )
@@ -93,7 +88,7 @@ def verify_signature(data: str):
93
88
}
94
89
95
90
96
- def verify_handler (data : str ):
91
+ def verify_handler (data : str ) -> dict :
97
92
"""Verify input data."""
98
93
return verify_signature (data )
99
94
0 commit comments