React Native component to verify the signature of a JWT string representation of a Verifiable Credential.
npm install react-native-vcimport{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
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)See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT