@bedrock/vc-verifier 22.1.0 → 22.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/vcb.js +6 -0
- package/package.json +1 -1
package/lib/vcb.js
CHANGED
|
@@ -27,6 +27,8 @@ const SUPPORTED_BARCODE_FORMATS = new Set([
|
|
|
27
27
|
'pdf417'
|
|
28
28
|
]);
|
|
29
29
|
|
|
30
|
+
const TEXT_DECODER = new TextDecoder();
|
|
31
|
+
|
|
30
32
|
export async function verifyEnvelopedCredential({
|
|
31
33
|
config, contents, format, checks
|
|
32
34
|
} = {}) {
|
|
@@ -76,6 +78,10 @@ export async function verifyEnvelopedCredential({
|
|
|
76
78
|
async function _parseQrCodeEnvelope({
|
|
77
79
|
contents, documentLoader, typeTableLoader
|
|
78
80
|
}) {
|
|
81
|
+
// `fromQrCode` requires text, so convert to text as needed
|
|
82
|
+
if(contents instanceof Uint8Array) {
|
|
83
|
+
contents = TEXT_DECODER.decode(contents);
|
|
84
|
+
}
|
|
79
85
|
const {jsonldDocument: credential} = await util.fromQrCode({
|
|
80
86
|
text: contents,
|
|
81
87
|
documentLoader,
|