From 2253f433a03e4d5cbc22f87d469fbe0adadc250e Mon Sep 17 00:00:00 2001 From: Orie Steele Date: Sun, 11 Aug 2024 13:12:08 -0500 Subject: [PATCH] cleanup media types --- README.md | 26 +++++++++++++------------- test/__fixtures__/claimset_1.yml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5c43b04..bc14a22 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ const issuerSigner = { const issued = await transmute .issuer({ alg, - type: "application/vc+ld+json+jwt", + type: "application/vc-ld+jwt", signer: issuerSigner, }) .issue({ @@ -173,11 +173,11 @@ const validated = await transmute } if (id === `${baseURL}/credentials/status/3`) { return { - type: `application/vc+ld+json+jwt`, + type: `application/vc-ld+jwt`, content: await transmute .issuer({ alg: "ES384", - type: "application/vc+ld+json+jwt", + type: "application/vc-ld+jwt", signer: issuerSigner, }) .issue({ @@ -207,11 +207,11 @@ credentialSubject: } if (id === `${baseURL}/credentials/status/4`) { return { - type: `application/vc+ld+json+jwt`, + type: `application/vc-ld+jwt`, content: await transmute .issuer({ alg: "ES384", - type: "application/vc+ld+json+jwt", + type: "application/vc-ld+jwt", signer: issuerSigner, }) .issue({ @@ -239,7 +239,7 @@ credentialSubject: }), }; } - if (content != undefined && type === `application/vc+ld+json+jwt`) { + if (content != undefined && type === `application/vc-ld+jwt`) { const { kid } = jose.decodeProtectedHeader( transmute.text.decoder.decode(content) ); @@ -256,7 +256,7 @@ credentialSubject: }, }) .validate({ - type: "application/vc+ld+json+jwt", + type: "application/vc-ld+jwt", content: issued, }); @@ -272,7 +272,7 @@ credentialSubject: const presentation = await transmute .holder({ alg, - type: "application/vp+ld+json+jwt", + type: "application/vp-ld+jwt", }) .issue({ signer: issuerSigner, @@ -283,13 +283,13 @@ const presentation = await transmute // this part is built from disclosures without key binding below. // "verifiableCredential": [{ // "@context": "https://www.w3.org/ns/credentials/v2", - // "id": "data:application/vc+ld+json+sd-jwt;QzVjV...RMjU", + // "id": "data:application/vc-ld+sd-jwt;QzVjV...RMjU", // "type": "EnvelopedVerifiableCredential" // }] }, disclosures: [ { - type: `application/vc+ld+json+jwt`, + type: `application/vc-ld+jwt`, credential: issued, }, ], @@ -305,7 +305,7 @@ const validation = await transmute resolve: async ({ type, content }) => { // Resolve external resources according to verifier policy // In this case, we return inline exampes... - if (content != undefined && type === `application/vp+ld+json+jwt`) { + if (content != undefined && type === `application/vp-ld+jwt`) { const { kid } = jose.decodeProtectedHeader( transmute.text.decoder.decode(content) ); @@ -322,7 +322,7 @@ const validation = await transmute }, }) .validate({ - type: `application/vp+ld+json+jwt`, + type: `application/vp-ld+jwt`, content: presentation, }); // { @@ -338,7 +338,7 @@ const validation = await transmute // "verifiableCredential": [ // { // "@context": "https://www.w3.org/ns/credentials/v2", -// "id": "data:application/vc+ld+json+jwt;eyJraWQiOiJkaWQ6ZX... +// "id": "data:application/vc-ld+jwt;eyJraWQiOiJkaWQ6ZX... ``` ## Develop diff --git a/test/__fixtures__/claimset_1.yml b/test/__fixtures__/claimset_1.yml index f04376b..8c78bdd 100644 --- a/test/__fixtures__/claimset_1.yml +++ b/test/__fixtures__/claimset_1.yml @@ -8,5 +8,5 @@ holder: id: "https://university.example/issuers/565049" verifiableCredential: - "@context": "https://www.w3.org/ns/credentials/v2" - id: "data:application/vc+ld+json+sd-jwt;QzVjV...RMjU" + id: "data:application/vc-ld+sd-jwt;QzVjV...RMjU" type: EnvelopedVerifiableCredential