Skip to content

Repository files navigation

react-native-vc

React Native component to verify the signature of a JWT string representation of a Verifiable Credential.

Installation

npm install react-native-vc

Usage

import{verifySignature}from"react-native-vc";// ...constisValid=verifySignature(jwtStr);

See complete React Native sample in https://github.com/idpass/react-native-vc/tree/main/example/src

How to construct the JWT string from a Verifiable Credential (VC) in JSON format

With an existing sample VC stored as a file, do:

constfs=require('fs')constvc=fs.readFileSync('filename.json')constvcJson=JSON.parse(vc)varparts=vcJson.event.data.proof.signature.split('.')constjwtStr=parts[0]+'.'+vcJson.event.data.credential+'.'+parts[2]// Then verify the signature of jwtStrvarisValid=verifySignature(jwtStr)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

About

React Native library to verify JWT Signature

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages