Skip to content

Commit

Permalink
cleanup media types
Browse files Browse the repository at this point in the history
  • Loading branch information
OR13 committed Aug 11, 2024
1 parent 2e4b47c commit 2253f43
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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)
);
Expand All @@ -256,7 +256,7 @@ credentialSubject:
},
})
.validate({
type: "application/vc+ld+json+jwt",
type: "application/vc-ld+jwt",
content: issued,
});

Expand All @@ -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,
Expand All @@ -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,
},
],
Expand All @@ -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)
);
Expand All @@ -322,7 +322,7 @@ const validation = await transmute
},
})
.validate<transmute.TraceablePresentationValidationResult>({
type: `application/vp+ld+json+jwt`,
type: `application/vp-ld+jwt`,
content: presentation,
});
// {
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/__fixtures__/claimset_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2253f43

Please sign in to comment.