sima 1.0.1+1
sima: ^1.0.1+1 copied to clipboard
Flutter plugin for SIMA digital signature integration.
[assets/logo/sima_logo.png]
SIMA Flutter Plugin #
A Flutter plugin that enables secure digital signature authentication using the SIMA mobile application.
This plugin handles:
- Challenge generation
- HMAC-SHA256 signing
- SIMA app deep-linking
- Native callback handling (Android & iOS)
✅ Asset image paths are handled inside the plugin
❌ No need to convert images to Base64 in your app
🔐 Sensitive credentials are never exposed
Features #
- 🔐 Secure challenge–response signing
- 📱 Native SIMA app integration
- 🧩 Simple Flutter API
- 🤖 Android & 🍎 iOS support
- 🖼 Accepts asset image path, not Base64
- 🧼 Minimal app-side configuration
Installation #
Add the plugin to your pubspec.yaml:
dependencies:
sima: ^1.0.0
Then run:
flutter pub get
Assets #
Add your logo to your app assets:
flutter:
assets:
- assets/logo.png
You only pass the asset path to the plugin.
Usage #
Basic Example #
import 'package:sima/sima.dart';
final response = await Sima.start(
clientMasterKey: '<YOUR_MASTER_KEY>',
returnScheme: 'your-app-scheme',
serviceName: 'Your App Name',
logoAssetPath: 'assets/logo.png',
);
if (response == null) {
// cancelled or failed
} else if (response.isSuccess) {
print(response.signature);
print(response.certificate);
} else {
print(response.message);
}
API #
Sima.start(...) #
| Parameter | Type | Required | Description |
|---|---|---|---|
clientMasterKey |
String |
✅ | Secret key used for signing |
returnScheme |
String |
✅ | App URL scheme for callback |
serviceName |
String |
✅ | Displayed in SIMA app |
logoAssetPath |
String |
✅ | Asset image path (PNG/JPG) |
Response #
class SimaResponse {
final String status;
final String? signature;
final String? certificate;
final String? challenge;
final String? requestId;
final String? message;
bool get isSuccess => status == 'success';
}
Platform Setup #
iOS #
Add your custom URL scheme to Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>your-app-scheme</string>
</array>
</dict>
</array>
No other AppDelegate changes required.
Android #
The plugin internally handles:
- Intent creation
- SIMA app detection
- Activity result handling
No manual changes required in your app’s AndroidManifest.xml.
Error Handling #
| Case | Result |
|---|---|
| SIMA app not installed | PlatformException |
| User cancels | null |
| Signature failure | isSuccess == false |
Security Notes #
- Never hardcode secrets in UI code
- Store
clientMasterKeysecurely - Always validate signature server-side
License #
MIT License
Disclaimer #
This plugin is not officially affiliated with SIMA.
Use according to SIMA platform terms and security requirements.