React Native component to verify the signature of a JWT string representation of a Verifiable Credential.
npm install react-native-vc
import { verifySignature } from "react-native-vc";
// ...
const isValid = 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:
const fs = require('fs')
const vc = fs.readFileSync('filename.json')
const vcJson = JSON.parse(vc)
var parts = vcJson.event.data.proof.signature.split('.')
const jwtStr = parts[0] + '.' + vcJson.event.data.credential + '.' + parts[2]
// Then verify the signature of jwtStr
var isValid = verifySignature(jwtStr)
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT