> For the complete documentation index, see [llms.txt](https://docs.vida.id/identity-stack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.vida.id/identity-stack/authentication/authentication-factors/cryptographic-token-pki/integration-methods/sdk/ios-development-kit/signing-messages.md).

# 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.&#x20;
* 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.
