DEV Community

HarmonyOS
HarmonyOS

Posted on

How can I obtain the signature and SHA1 values for my HarmonyOS app?

Read the original article:How can I obtain the signature and SHA1 values for my HarmonyOS app?

Question

How can I obtain the signature and SHA1 values for my HarmonyOS app?

Short Answer

  • The payment public key is obtained when activating the in-app payment service on the Huawei Developer Alliance.
  • Use the Sign.getSignSpec, Sign.update, and Sign.sign methods to generate a data signature.
  • It is not possible to obtain the SHA1 fingerprint of the app package. Instead, you will get the SHA256 hash value of the app signing certificate (.cer file).

Applicable Scenarios

  • When enabling in-app payment services and requiring a payment public key.
  • When generating and verifying RSA signatures using HarmonyOS APIs.
  • When working with app signing certificates and verifying app identity.

Reference Link

https://developer.huawei.com/consumer/en/doc/harmonyos-guides/crypto-rsa-sign-sig-verify-pss

https://developer.huawei.com/consumer/en/doc/harmonyos-references-V13/js-apis-bundlemanager-bundleinfo-V13#signatureinfo

Written by Arif Emre Ankara

Top comments (0)