Inji
GitHubCommunityWhat's NewChatBot
  • Inji
    • Try It Out
      • Using Mock Data
    • Use case
    • Resources
    • Roadmap
      • Roadmap 2025
      • Roadmap 2024
    • Supported Integrations
      • MOSIP
    • Project Governance
    • Contribution
      • Code Contribution
      • Code of Conduct
    • GenderMag
    • License
    • Setup
      • Infrastructure Requirements
      • Deploy
  • Inji Wallet
    • Inji Mobile
      • Overview
        • Features
      • Develop
        • Architecture
        • Technical Stack
        • Components
        • Integration Guides
          • Face Match
          • Secure Keystore
          • Tuvali
            • Permissions & Requirements
            • Tuvali API Documentation
          • BLE Verifier
          • PixelPass
          • Telemetry
          • VCI-Client
          • OpenID4VP
        • Specifications
          • Face SDK Specifications
        • Backend Services
          • Mimoto
          • eSignet
          • Inji Certify
        • Customizations
          • Workflow customization
          • UI customization
          • Locale customization
          • Configuration
          • Credential Providers
      • Test
        • Try It Out
          • Inji Mobile - Collab Guide
        • Workflow
        • End User Guide
      • Setup
        • Local Setup
      • Releases
        • Version 0.16.0
          • Test Report
        • Version 0.15.1
          • Test Report
        • Version 0.15.0
          • Test Report
        • Version 0.14.1
          • Test Report
        • Version 0.14.0
          • Test Report
        • Version 0.13.1
          • Test Report
        • Version 0.13.0
          • Test Report
        • Version 0.12.0
          • Test Report
        • Version 0.11.0-Inji
          • Test Report
        • Version 0.11.0
        • Version DP2
          • Test Report
        • Version 0.10.0
          • Test Report
        • Version DP1
        • Version 0.9.1
          • Test Report
        • Version 0.9.0
          • Test Report
    • Inji Web
      • Overview
        • Features
      • Develop
        • Architecture
        • Technology Stack
        • Backend services
          • Mimoto - BFF
          • eSignet - Authentication Layer
          • Configurations
        • Customizations
          • UI Customizations
          • Locale Customizations
          • Credential Providers
          • Customize VC PDF Template
        • Supported Browsers
      • Test
        • Try It Out
          • Inji Web - Collab Guide
        • Workflow
        • End User Guide
      • Setup
        • Local setup
      • Releases
        • Version 0.12.0
          • Test Report
        • Version v0.11.1
          • Test Report
        • Version 0.11.0
          • Test Report
        • Version 0.10.0
          • Test Report
        • Version 0.9.0
          • Test Report
        • Version 0.8.1
        • Version 0.8.0
          • Test Report
  • INJI CERTIFY
    • Overview
      • Features
    • Develop
      • Technology Stack
      • Components
      • Tested Operating Systems
    • Test
      • Functional Overview
      • Workflow
    • Setup
      • Local Setup
    • Releases
      • Version 0.11.0
        • Test Report
      • Version 0.10.2
        • Test Report
      • Version 0.10.1
        • Test Report
      • Version 0.9.1
        • Test Report
      • Version 0.9.0
        • Test Report
      • Version 0.8.1
      • Version 0.8.0
    • FAQ
      • FAQ
  • INJI VERIFY
    • Overview
      • Features
    • Develop
      • Technology Stack
      • Components
      • Supported Browsers
      • Customization
        • UI Customizations
        • Locale Customizations
      • Integration Guides
        • OpenID4VP-VP Verification Integration Guide
    • Test
      • Try It Out
        • Inji Verify - Collab Guide
      • Workflow
      • End User Guide
      • Functional Overview
    • Setup
      • Local Setup
      • Generate QR Code
    • Releases
      • Version 0.12.0
        • Test Report
      • Version 0.11.1
        • Test Report
      • Version 0.11.0
        • Test Report
      • Version 0.10.0
        • Test Report
      • Version 0.9.0
        • Test Report
      • Version 0.8.1
      • Version 0.8.0
        • Test Report
  • FAQ
Powered by GitBook

Copyright © 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.

On this page
  • Platforms Supported
  • Artifacts
  • 📦 Installation
  • iOS (Swift)
  • Android (Kotlin)
  • 📘 API Documentation

Was this helpful?

Export as PDF
  1. Inji Wallet
  2. Inji Mobile
  3. Develop
  4. Integration Guides

Secure Keystore

Last updated 1 month ago

Was this helpful?

Secure Keystore is a cross-platform cryptographic key management library for Android and iOS, supporting secure key generation, encryption/decryption, HMAC, and digital signatures using native platform security features (Android Keystore and iOS Keychain/Secure Enclave).

Platforms Supported

  • Android 6.0+ (Hardware-backed keystore)

  • iOS 13.0+ (Secure Enclave + Keychain)


Artifacts

  • Maven Snapshots are available

📦 Installation

iOS (Swift)

Using Swift Package Manager:

  1. Open Xcode

  2. Go to File > Swift Packages > Add Package Dependency

  3. Use the URL: https://github.com/mosip/secure-keystore-ios-swift.git

Android (Kotlin)

Add the following in your settings.gradle.kts:

dependencyResolutionManagement {
  repositories {
    google()
    mavenCentral()
    maven("https://oss.sonatype.org/content/repositories/snapshots/")
  }
}

In build.gradle.kts:

dependencies {
  implementation("io.mosip:secure-keystore:0.3.0")
}

📘 API Documentation

  • deviceSupportsHardware() => boolean Checks if the device supports secure hardware-backed keystore.

  • generateKey(alias, isAuthRequired, authTimeout?) Generates a symmetric key for encryption/decryption with optional biometric auth.

  • generateKeyPair(type, alias, isAuthRequired, authTimeout?) Creates a public-private key pair (RSA or EC) with optional authentication.

  • encryptData(alias, data, onSuccess, onFailure) Encrypts data using a symmetric key associated with the given alias.

  • decryptData(alias, encryptedText, onSuccess, onFailure) Decrypts previously encrypted data using the associated key alias.

  • sign(signAlgorithm, alias, data, onSuccess, onFailure) Signs data using the specified key and signature algorithm (RSA, ECDSA are supported).

  • generateHmacSha(alias, data, onSuccess, onFailure) Generates an HMAC signature using the specified alias and data.

  • generateHmacSha256Key(alias) Creates a symmetric key suitable for HMAC-SHA256 operations.

  • hasAlias(alias) => boolean Checks if a key exists for the specified alias.

  • removeKey(alias) Deletes the key associated with the given alias from the keystore.

  • removeAllKeys() Clears all keys stored in the keystore.

  • retrieveKey(alias) Retrieves the public key for the specified alias.

  • storeGenericKey(publicKey, privateKey, account) Stores a custom key pair in the keychain/keystore linked to an account.

  • retrieveGenericKey(account) Retrieves the stored key pair associated with the specified account.


here