diff --git a/demo/api_demo/co_signer/co_signer_converter_demo.py b/demo/api_demo/co_signer/co_signer_converter_demo.py index e6994ba..05870a9 100644 --- a/demo/api_demo/co_signer/co_signer_converter_demo.py +++ b/demo/api_demo/co_signer/co_signer_converter_demo.py @@ -16,13 +16,15 @@ def test_co_signer_converter(self): config = read_yaml("./config.yaml") converter = CoSignerConverter(config) # The CoSignerCallBack received by the controller + # Visit the following link to view the request data specification:https://docs.safeheron.com/api/en.html#API%20Co-Signer%20Request%20Data co_signer_call_back = {} - biz_content = converter.request_convert(co_signer_call_back) + biz_content = converter.request_v3_convert(co_signer_call_back) # According to different types of CoSignerCallBack, the customer handles the corresponding type of business logic. print(biz_content) - coSignerResponse = CoSignerResponse() - coSignerResponse.approve = True - coSignerResponse.txKey = "TxKey that needs to be approved" - encryptResponse = converter.response_converter_with_new_crypto_type(coSignerResponse) + # Visit the following link to view the response data specification.:https://docs.safeheron.com/api/en.html#Approval%20Callback%20Service%20Response%20Data + coSignerResponse = CoSignerResponseV3() + coSignerResponse.action = "" + coSignerResponse.approvalId = "" + encryptResponse = converter.response_v3_converter(coSignerResponse) # The customer returns encryptResponse after processing the business logic. diff --git a/demo/api_demo/co_signer/config.yaml.example b/demo/api_demo/co_signer/config.yaml.example index be2b57a..355e65d 100644 --- a/demo/api_demo/co_signer/config.yaml.example +++ b/demo/api_demo/co_signer/config.yaml.example @@ -1,6 +1,6 @@ -# RSA private key (biz_privkey) is configured in the audit service, as an alternative, you can use bizPrivKeyPemFile to config your bizPrivKey -bizPrivKey: MIIJRQIBA*******DtGRBdennqu8g95jcrMxCUhsifVgzP6vUyg== -# path to your private key file, pem encoded. BizPrivKeyPemFile priority is higher than bizPrivKey. -bizPrivKeyPemFile: './my_private.pem' -# RSA public key (api_pubkey) is used in the API Key configuration on Safeheron Web Console. -apiPubKey: MIICI****QuTOTECAwEAAQ== \ No newline at end of file +# The private key used by the Approval Callback Service must be the private key that corresponds to the public key uploaded when creating the API Key. +approvalCallbackServicePrivateKey: MIIJRQIBA*******DtGRBdennqu8g95jcrMxCUhsifVgzP6vUyg== +# path to your private key file, pem encoded. approvalCallbackServicePrivateKeyPemFile priority is higher than approvalCallbackServicePrivateKey. +approvalCallbackServicePrivateKeyPemFile: './my_private.pem' +# Use the export-public-key command of the API Co-Signer CLI to export the API Co-Signer's public key. +coSignerPubKey: MIICI****QuTOTECAwEAAQ==