Skip to content

Latest commit

 

History

History
93 lines (57 loc) · 5.76 KB

File metadata and controls

93 lines (57 loc) · 5.76 KB


Sphereon
Test application for the MUSAP React Native module


About This Application

This test application is designed to demonstrate and validate the functionality of the MUSAP (Mobile Universal Signing Application Protocol) React Native module. MUSAP is a library that provides a standardized way to interact with various secure signature creation devices (SSCDs) and the MUSAP key management system in SSI-SDK-crypto-extensions (KMS) in mobile environments.

Key Features

  1. SSCD Integration: The app tests the integration with Trusted Execution Environment (TEE) as an SSCD.
  2. Key Management: Demonstrates key generation, retrieval, and deletion using both direct MUSAP module calls and a Key Management System (KMS).
  3. JWT Signing: Shows the process of creating and signing JSON Web Tokens (JWTs) using generated keys.
  4. Multiple Test Scenarios: Includes both direct MUSAP module testing (testRunDirect) and KMS-based testing (kmsTestRun).

What This App Does

When you run this application:

  1. It initializes the MUSAP module and enables the TEE SSCD.
  2. Generates cryptographic keys using both direct MUSAP calls and the KMS.
  3. Creates a sample JWT payload and header.
  4. Signs the JWT using the generated keys.
  5. Outputs the signed JWT to the console.
  6. Demonstrates key deletion and error handling.

This process helps verify that all components of the MUSAP ecosystem are working correctly together in a React Native environment.

Getting Started

$ yarn add @sphereon/react-native-musap

Note: Since this is a mono-repository yarn 4.x or higher is required

Step 1: Start the Metro Server

First, you will need to start Metro, the JavaScript bundler that ships with React Native.

To start Metro, run the following command from the root of your React Native project:

yarn start

Step 2: Start your Application

Let Metro Bundler run in its own terminal. Open a new terminal from the root of your React Native project. Run the following command to start your Android or iOS app:

For Android

yarn android

For iOS

yarn ios

If everything is set up correctly, you should see your new app running in your Android Emulator or iOS Simulator shortly provided you have set up your emulator/simulator correctly.

This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.

Test output

When all goes well the console log spits out a verifiable JWT

 LOG  jwt eyJ0eXAiOiJKV1QiLCJraWQiOiIyMjJGQzZGMi1COUY0LTQzNDQtOUFGNi03QTkzOTdCNDJENTciLCJhbGciOiJFUzI1NiIsImp3ayI6eyJrdHkiOiJFQ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03VUVNcUJrRTkvUWNvRDNUZ215K3owaE4rNGVreTFSbkpzRWc9Iiwibm9uY2UiOiI2aTNkVHo1eUZmV0o4emdzYW11eVphNHlBSFBtNzV0VU9PWGRkUjZrckN2Q1lrNzdzYkNPdUVWY2RCQ0RkL2w2dElZPSJ9fV19fQ.S4kpCAafwR-0wVmXBRn0ThEoZ4GOCpCbkmxcZGSuUvCp-udKwG5N6BShHDpKnHbMtO1MUpwcrNZAz8bDsRgFNA

This JWT can be decoded and verified using tools like jwt.io to confirm the correct functioning of the MUSAP module.

Note: This code is still under construction. The end goal is to enable detox for testing, but this is not yet functional.

For more information about MUSAP and its capabilities, please visit Methics's website.
For more information about credential wallets & SSI technology, please visit Sphereon's website.

License

This project is licensed under the Apache-2 License.