How to generate P2P message Peer fingerprint for the WearEngine integration in Harmony lite wearable?
Wear Engine allows the share of app features and services between phones and wearable devices, for a rich interactive experience. PeerFingerPrint is an ID to connect our Smartphone application to the wear application. In this article, we will generate a peer fingerprint for the wear engine communication.
1. DevEco IDE
2. Huawei Developer Account
Follow the steps to generate the fingerprint
Peer fingerprint Generation Process
Step 1: Generate the .cer file. Follow the steps given in this article (https://forums.developer.huawei.com/forumPortal/en/topic/0202465210302250053).
Step 2: Navigate to the directory where you saved the .cer file.
Uncheck the Hide extensions from known file types. Click Apply and OK.
Step 3: Change the extension of the .cer file to .txt and open it. Find out the last token of the text file as given on the below screenshot. There will be multiple tokens are present on the file. Make sure that you are selected the last item.
Step 4: Copy the content and create a new text file with only the last token. Rename the extension to .cer again.
Step 5: Double click and open the newly converted .cer file.
Step 6: Copy the public key. Convert it from Hexadecimal to Base 64. You can use any of the third-party Base 64 convertors. I have used tomeko website for the conversion (http://www.tomeko.net/online_tools/hex_to_base64.php?lang=en)
Step 7: Copy the converted output and generate the fingerprint as given below.
Fingerprint information = App package name _base64Encode(pubKey),
For example: com.huawei.wearengine_BC5Z9/29Yn93xSa9XkQ2HN5GikugmXjor9se0VwnOENK9t4uFK4VlRpOHv4B3lphjIa7P6Sh61CFRsT0MZNhuV8=
Tips and Tricks
- Make sure you have selected the last item of Begin text and End text. If not, you will not get the proper fingerprint.
- You have to use the release version of .cer for fingerprint, if you are going to release the application on AG.
In this article, we learned the steps to generate the peer fingerprint. This fingerprint is required if we need to connect a smartphone with a Harmony Lite wearable.
- Wear engine documentation: https://developer.huawei.com/consumer/en/doc/development/connectivity-Guides/signature-0000001053969657
- Harmony Official document: https://developer.harmonyos.com/en/docs/documentation/doc-guides/harmonyos-overview-0000000000011903
- DevEco Studio User guide: https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387