Introducing VIDA Identity Stack: All of VIDA, in one place 🎉
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Signing Messages

The mobile app can utilise the following methods in the CDK to sign messages with or without user presence:

  • signMessage(messageHash: String, completion: @escaping VIDAResultBlock): This method signs the provided message hash and returns the message signature in the completion block's NSDictionary. It's important to ensure that the message hash does not contain encapsulated whitespaces or newline characters.

  • signMessageWithUserPresence(messageHash: String, password: String, completion: @escaping VIDAResultBlock): This method allows signing a message with user presence by providing a password. The resulting message signature can be obtained from the completion block's NSDictionary.

Enabling User Presence with Biometrics:

  • To enable signing with biometrics, developers should invoke the enableBiometrics(password: String, completion: @escaping VIDAResultBlock) method.

  • To sign a message using biometrics, call the signMessageWithUserPresence(messageHash: String, localizedBiometricReason: String, completion: @escaping VIDAResultBlock) method. The localizedBiometricReason parameter is used as a description in the biometric authentication popup.

Disabling Biometrics:

  • To disable biometrics and prompt for biometric authorization again, developers can use the disableBiometrics(completion: @escaping VIDAResultBlock) method.

Checking Biometry Availability:

Developers can check if biometry (such as Selfie ID or Fingerprint) is available on the current device by calling the isBiometryAvailable() -> Bool method.

By utilizing these methods, developers can enable secure message signing and leverage biometric authentication for enhanced user experience and security.

Last updated