This shell script can be used to quickly generate a large volume of VCs for testing purposes. The generated VCs use the bare-minimum schema and contain essentially nothing aside from a unique UUID each, in the
To generate these VC ids, they use the commonplace uuidgen command. For more realistic sample VCs, simply start with a credential definition from a real-world context, and populate values for all the fields, such as names and addresses, with command-line tools or spreadsheets of dummy data.
- This will generate a file named
credswith a stringified verifiable credential on each line, with as many lines as the value of
In this script, a verification method is derived from a local key and manually passed with the -v parameter. This is not the default behavior of DIDKit's verification function, but it greatly accelerates the verification of a large batch of VCs being testing against the known key material and verification method of a known issuer.
Were one to remove the
key.jwk check, the generation of a verification method, and the passing of that method to the verification function, a verification method would be extracted for each VC verified, from the DID Document of the issuer, which would be resolved each time as specified in the VC being verified. This is the default behavior of DIDKit.
Here we loop through the file created above, verifying the credential contained on each line.
Also available on Github as