Skip to main content
The PIN gates signMessage, signTransactionHash, and deleteWallet when requirePin: true. It is stored only as a salted PBKDF2-HMAC-SHA256 digest inside flutter_secure_storage — the raw PIN never touches disk.

Set a PIN

Call setPin once after wallet provisioning. The PIN must be exactly BmoniEmbeddedSdk.pinLength characters (default 6).
Throws pinAlreadySet if a PIN already exists. Check first:

Check whether a PIN is set


Verify a PIN without throwing

Use matchPin to check a PIN without triggering an exception. Useful for validating a user’s entry before attempting a gated operation.

Change a PIN

Requires the current PIN. Both the current and new PINs must be pinLength characters.

Remove a PIN

Removes the stored digest entirely. After removal, hasPin() returns false and PIN-gated operations are unavailable until a new PIN is set.

PIN length enforcement

All PIN operations enforce the pinLength set in BmoniEmbeddedSdk.initialize. Passing a PIN of the wrong length throws BmoniSignerException(errorCode: pinInvalid). You can read the required length at runtime to drive your UI:

Full example