davidortinau/maui-skills/maui-secure-storage
Claude Code and agent skill by davidortinau/maui-skills
- community
Checking that the SKILL.md file is still in the repository.
Add secure storage to .NET MAUI apps using SecureStorage.Default. Covers SetAsync, GetAsync, Remove, RemoveAll, platform setup (Android backup rules, iOS Keychain entitlements, Windows limits), common pitfalls, and a DI wrapper service for testability. USE FOR: "secure storage", "SecureStorage", "store token securely", "Keychain", "Android Keystore", "save secret", "encrypted storage", "store credentials", "sensitive data storage". DO NOT USE FOR: general file storage (use maui-file-handling), SQLite databases (use maui-sqlite-database), or authentication flows (use maui-authentication).
Install
npx vskill@latest install davidortinau/maui-skills/maui-secure-storageSKILL.md
Secure Storage — Gotchas & Best Practices
Critical Platform Pitfalls
⚠️ Android: Auto Backup Breaks Encrypted Values
Auto Backup restores encrypted preferences to a new device where the encryption key is invalid — this throws unrecoverable exceptions. You must either disable Auto Backup or exclude secure storage files from backup. See references/secure-storage-api.md for setup options.
⚠️ Android: Always Wrap in try/catch
Corrupted values from backup restoration throw exceptions. Never call GetAsync unprotected:
⚠️ iOS: Keychain Entitlements on Simulator
Add keychain access groups for Simulator builds, but remove before physical device / App Store builds — they cause signing issues on devices where they aren't needed.
⚠️ iOS: Uninstall Does NOT Clear Keychain
Unlike Android, uninstalling an iOS app does not remove its Keychain entries. Values persist and are available if the app is reinstalled. Design for this — don't assume a fresh install means empty storage.
⚠️ iOS: iCloud Keychain Sync
Values may sync across devices via iCloud Keychain if the user has it enabled. This is platform behavior, not controllable from MAUI. Don't store device-specific tokens that shouldn't roam.
Windows Limits
- Key name: max 255 characters
- Value: max 8 KB per setting
- Composite storage: max 64 KB total
Common Mistakes
Decision Framework
| Question | Answer | |
|---|---|---|
| Storing a token, password, or API key? | ✅ Use SecureStorage | |
| Storing user preferences or settings? | ❌ Use Preferences instead | |
| Storing large files or blobs? | ❌ Use file system + encryption | |
| Need cross-device sync? | ⚠️ iOS syncs via iCloud Keychain automatically | |
| Need data cleared on uninstall? | ⚠️ Only works on Android, not iOS |
Testability: Always Use DI
Never call SecureStorage.Default directly from ViewModels — wrap it in an ISecureStorageService interface for testability. See references/secure-storage-api.md for the full DI wrapper pattern with mock examples.
Checklist
- [ ] Android: Auto Backup disabled or secure storage excluded from backup
- [ ] Android: All
GetAsynccalls wrapped in try/catch - [ ] iOS: Keychain entitlements configured (Simulator only — remove for device builds)
- [ ] Values are strings only — complex data serialized to JSON
- [ ] No secret values logged anywhere
- [ ]
SecureStorage.Defaultaccessed via DI wrapper, not directly from ViewModels
Security
- Security scanPassed, 70 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/maui-skills/skills/maui-secure-storage/SKILL.md
Popularity
- Repository stars
- 113
- Repository forks
- 16
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 9 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davidortinau/maui-skills/maui-secure-storage)