-
Notifications
You must be signed in to change notification settings - Fork 12
/
vcwg.diagnostic.sh
executable file
·53 lines (44 loc) · 3.77 KB
/
vcwg.diagnostic.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
echo '{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"type": ["VerifiableCredential", "MyPrototypeCredential"],
"credentialSubject": {
"mySubjectProperty": "mySubjectValue"
}
}' > ./tests/fixtures/issuer-claims.json
# JWT
npm run -s transmute -- vcwg issuer-claims ./tests/fixtures/issuer-claims.json --output ./tests/fixtures/issuer-claims.yaml
npm run -s transmute -- vcwg issue-credential ./tests/fixtures/private.sig.jwk.json ./tests/fixtures/issuer-claims.yaml --credential-type application/vc-ld+jwt --output ./tests/fixtures/issuer-claims.jwt
npm run -s transmute -- vcwg verify-credential ./tests/fixtures/public.sig.jwk.json ./tests/fixtures/issuer-claims.jwt --credential-type application/vc-ld+jwt --output ./tests/fixtures/issuer-claims.jwt.verified.json
npm run -s transmute -- vcwg issue-presentation ./tests/fixtures/private.sig.jwk.json ./tests/fixtures/issuer-claims.jwt --credential-type application/vc-ld+jwt --presentation-type application/vp-ld+jwt --output ./tests/fixtures/holder-claims.jwt
npm run -s transmute -- vcwg verify-presentation ./tests/fixtures/public.sig.jwk.json ./tests/fixtures/holder-claims.jwt --presentation-type application/vp-ld+jwt --output ./tests/fixtures/holder-claims.jwt.verified.json
# SD-JWT
echo '"@context":
- https://www.w3.org/ns/credentials/v2
- https://www.w3.org/ns/credentials/examples/v2
type:
- VerifiableCredential
- MyPrototypeCredential
credentialSubject:
!sd mySubjectProperty: mySubjectValue
' > ./tests/fixtures/issuer-disclosable-claims.yaml
echo '"@context":
- https://www.w3.org/ns/credentials/v2
- https://www.w3.org/ns/credentials/examples/v2
type:
- VerifiableCredential
- MyPrototypeCredential
credentialSubject:
mySubjectProperty: mySubjectValue
' > ./tests/fixtures/holder-disclosed-claims.yaml
npm run -s transmute -- vcwg issue-credential ./tests/fixtures/private.sig.jwk.json ./tests/fixtures/issuer-disclosable-claims.yaml --credential-type application/vc-ld+sd-jwt --output ./tests/fixtures/issuer-disclosable-claims.sd-jwt
npm run -s transmute -- vcwg verify-credential ./tests/fixtures/public.sig.jwk.json ./tests/fixtures/issuer-disclosable-claims.sd-jwt --credential-type application/vc-ld+sd-jwt --output ./tests/fixtures/issuer-disclosable-claims.sd-jwt.verified.json
npm run -s transmute -- vcwg issue-presentation ./tests/fixtures/private.sig.jwk.json ./tests/fixtures/issuer-disclosable-claims.sd-jwt ./tests/fixtures/holder-disclosed-claims.yaml --credential-type application/vc-ld+sd-jwt --presentation-type application/vp-ld+sd-jwt --output ./tests/fixtures/holder-disclosed-claims.sd-jwt
npm run -s transmute -- vcwg verify-presentation ./tests/fixtures/public.sig.jwk.json ./tests/fixtures/holder-disclosed-claims.sd-jwt --presentation-type application/vp-ld+sd-jwt --output ./tests/fixtures/holder-disclosed-claims.sd-jwt.verified.json
# COSE
npm run -s transmute -- vcwg issue-credential ./tests/fixtures/private.sig.jwk.json ./tests/fixtures/issuer-claims.yaml --credential-type application/vc-ld+cose --output ./tests/fixtures/issuer-claims.cbor
npm run -s transmute -- vcwg verify-credential ./tests/fixtures/public.sig.jwk.json ./tests/fixtures/issuer-claims.cbor --credential-type application/vc-ld+cose --output ./tests/fixtures/issuer-claims.cbor.verified.json
npm run -s transmute -- vcwg issue-presentation ./tests/fixtures/private.sig.jwk.json ./tests/fixtures/issuer-claims.cbor --credential-type application/vc-ld+cose --presentation-type application/vp-ld+cose --output ./tests/fixtures/holder-claims.cbor
npm run -s transmute -- vcwg verify-presentation ./tests/fixtures/public.sig.jwk.json ./tests/fixtures/holder-claims.cbor --presentation-type application/vp-ld+cose --output ./tests/fixtures/holder-claims.cbor.verified.json