Skip to content

Commit

Permalink
sd jwt working
Browse files Browse the repository at this point in the history
  • Loading branch information
decentralgabe committed Dec 13, 2024
1 parent a32a542 commit 7d5b686
Show file tree
Hide file tree
Showing 16 changed files with 198 additions and 114 deletions.
1 change: 1 addition & 0 deletions implementations/independent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
)

require (
github.com/MichaelFraser99/go-sd-jwt v1.2.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/fxamacker/cbor/v2 v2.5.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions implementations/independent/go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
github.com/MichaelFraser99/go-jose v0.9.0 h1:7vUcuJs5vGP0F+AQDStv6puqMYMmx75B4/Qc2CeKQR8=
github.com/MichaelFraser99/go-jose v0.9.0/go.mod h1:kdRvg7/FPcDnsEz8PyCg5hhcBlLud9F0jB4Xy/u771c=
github.com/MichaelFraser99/go-sd-jwt v1.2.1 h1:1Rf+Wy4jdPnRXRI4dvhjUsH2ygERYIrZETtiBtqIPos=
github.com/MichaelFraser99/go-sd-jwt v1.2.1/go.mod h1:1Kt/SQQEpexmeO0NrfPACRwn51NdhcqORikJDNDQMVA=
github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
57 changes: 46 additions & 11 deletions implementations/independent/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"github.com/decentralgabe/vc-jose-cose-go/cose"
"github.com/decentralgabe/vc-jose-cose-go/credential"
"github.com/decentralgabe/vc-jose-cose-go/jose"
"github.com/decentralgabe/vc-jose-cose-go/sdjwt"
"github.com/goccy/go-json"
"github.com/lestrrat-go/jwx/v2/jwk"
"os"
)

func Issue(inputFile, keyFile string, feature Feature) (*Result, error) {
func Issue(inputFile, keyFile string, disclosures []string, feature Feature) (*Result, error) {
fmt.Printf("Attempting to read input file: %s\n", inputFile)

// Read and parse the input file
Expand All @@ -36,16 +37,16 @@ func Issue(inputFile, keyFile string, feature Feature) (*Result, error) {

switch feature {
case JOSECredential, COSECredential, SDJWTCredential:
return IssueCredential(inputBytes, keyBytes, feature)
return IssueCredential(inputBytes, disclosures, keyBytes, feature)
case JOSEPresentation, COSEPresentation, SDJWTPresentation:
return IssuePresentation(inputBytes, keyBytes, feature)
return IssuePresentation(inputBytes, disclosures, keyBytes, feature)
default:
fmt.Printf("unsupported feature: %s\n", feature)
return &Result{Result: Indeterminate}, nil
}
}

func IssueCredential(credBytes, keyBytes []byte, feature Feature) (*Result, error) {
func IssueCredential(credBytes []byte, disclosures []string, keyBytes []byte, feature Feature) (*Result, error) {
var cred credential.VerifiableCredential
if err := json.Unmarshal(credBytes, &cred); err != nil {
return nil, fmt.Errorf("error unmarshaling credential: %v", err)
Expand All @@ -62,14 +63,14 @@ func IssueCredential(credBytes, keyBytes []byte, feature Feature) (*Result, erro
case COSECredential:
return IssueCOSECredential(cred, vm.SecretKeyJWK)
case SDJWTCredential:
return IssueSDJWTCredential(cred, vm.SecretKeyJWK)
return IssueSDJWTCredential(cred, disclosures, vm.SecretKeyJWK)
default:
fmt.Printf("unsupported credential feature: %s\n", feature)
return &Result{Result: Indeterminate}, nil
}
}

func IssuePresentation(presBytes, keyBytes []byte, feature Feature) (*Result, error) {
func IssuePresentation(presBytes []byte, disclosures []string, keyBytes []byte, feature Feature) (*Result, error) {
var pres credential.VerifiablePresentation
if err := json.Unmarshal(presBytes, &pres); err != nil {
return nil, fmt.Errorf("error unmarshaling presentation: %v", err)
Expand All @@ -86,7 +87,7 @@ func IssuePresentation(presBytes, keyBytes []byte, feature Feature) (*Result, er
case COSEPresentation:
return IssueCOSEPresentation(pres, vm.SecretKeyJWK)
case SDJWTPresentation:
return IssueSDJWTPresentation(pres, vm.SecretKeyJWK)
return IssueSDJWTPresentation(pres, disclosures, vm.SecretKeyJWK)
default:
fmt.Printf("unsupported presentation feature: %s\n", feature)
return &Result{Result: Indeterminate}, nil
Expand Down Expand Up @@ -124,8 +125,25 @@ func IssueCOSECredential(cred credential.VerifiableCredential, key jwk.Key) (*Re
}, nil
}

func IssueSDJWTCredential(cred credential.VerifiableCredential, key jwk.Key) (*Result, error) {
return nil, nil
func IssueSDJWTCredential(cred credential.VerifiableCredential, disclosures []string, key jwk.Key) (*Result, error) {
sdDisclosures := make([]sdjwt.DisclosurePath, len(disclosures))
for i, d := range disclosures {
sdDisclosures[i] = sdjwt.DisclosurePath(d)
}

sdJWT, err := sdjwt.SignVerifiableCredential(cred, sdDisclosures, key)
if err != nil {
fmt.Printf("error signing credential: %v", err)
return &Result{Result: Failure}, nil
}
if sdJWT == nil || *sdJWT == "" {
return &Result{Result: Failure}, nil
}

return &Result{
Result: Success,
Data: *sdJWT,
}, nil
}

func IssueJOSEPresentation(pres credential.VerifiablePresentation, key jwk.Key) (*Result, error) {
Expand Down Expand Up @@ -159,6 +177,23 @@ func IssueCOSEPresentation(pres credential.VerifiablePresentation, key jwk.Key)
}, nil
}

func IssueSDJWTPresentation(pres credential.VerifiablePresentation, key jwk.Key) (*Result, error) {
return nil, nil
func IssueSDJWTPresentation(pres credential.VerifiablePresentation, disclosures []string, key jwk.Key) (*Result, error) {
sdDisclosures := make([]sdjwt.DisclosurePath, len(disclosures))
for i, d := range disclosures {
sdDisclosures[i] = sdjwt.DisclosurePath(d)
}

sdJWT, err := sdjwt.SignVerifiablePresentation(pres, sdDisclosures, key)
if err != nil {
fmt.Printf("error signing credential: %v", err)
return &Result{Result: Failure}, nil
}
if sdJWT == nil || *sdJWT == "" {
return &Result{Result: Failure}, nil
}

return &Result{
Result: Success,
Data: *sdJWT,
}, nil
}
30 changes: 23 additions & 7 deletions implementations/independent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ type Result struct {

func main() {
if len(os.Args) < 4 {
panic("must supply [input, key, feature, output] arguments")
panic("must supply [input, key, feature, output] and optional [sd] arguments")
}

var input, key, feature, output string
var input, key, sd, feature, output string

verifyCmd := flag.NewFlagSet("verify", flag.ExitOnError)
verifyCmd.StringVar(&input, "input", "", "input file")
Expand All @@ -47,6 +47,7 @@ func main() {
issueCmd := flag.NewFlagSet("issue", flag.ExitOnError)
issueCmd.StringVar(&input, "input", "", "input file")
issueCmd.StringVar(&key, "key", "", "input key file")
issueCmd.StringVar(&sd, "sd", "", "SD-JWT disclosures")
issueCmd.StringVar(&feature, "feature", "", "feature to test (e.g credential_jose, presentation_sdjwt)")
issueCmd.StringVar(&output, "output", "", "output file")

Expand All @@ -60,10 +61,21 @@ func main() {

validateFlags(input, key, feature, output)

result, err := Issue(input, key, Feature(feature))
if err != nil {
fmt.Printf("error issuing %s: %s\n", feature, err.Error())
// Write failure result to output file
var disclosures []string
if sd != "" {
if err := json.Unmarshal([]byte(sd), &disclosures); err != nil {
fmt.Printf("error unmarshaling disclosures: %v\n", err)
os.Exit(1)
}
}

result, err := Issue(input, key, disclosures, Feature(feature))
if err != nil || result == nil {
if err != nil {
fmt.Printf("error issuing %s: %s\n", feature, err.Error())
} else {
fmt.Printf("error issuing %s: result is nil\n", feature)
}
writeEmptyResult(Failure, output)
os.Exit(1)
}
Expand All @@ -82,7 +94,11 @@ func main() {

result, err := Verify(input, key, Feature(feature))
if err != nil || result == nil {
fmt.Printf("error verifying %s: %s\n", feature, err.Error())
if err != nil {
fmt.Printf("error verifying %s: %s\n", feature, err.Error())
} else {
fmt.Printf("error verifying %s: result is nil\n", feature)
}
writeEmptyResult(Failure, output)
os.Exit(1)
}
Expand Down
22 changes: 19 additions & 3 deletions implementations/independent/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"github.com/decentralgabe/vc-jose-cose-go/cid"
"github.com/decentralgabe/vc-jose-cose-go/cose"
"github.com/decentralgabe/vc-jose-cose-go/jose"
"github.com/decentralgabe/vc-jose-cose-go/sdjwt"
"github.com/goccy/go-json"
"github.com/lestrrat-go/jwx/v2/jwk"
"github.com/pkg/errors"
"os"
"strings"
)

func Verify(inputFile, keyFile string, feature Feature) (*Result, error) {
Expand All @@ -23,7 +25,7 @@ func Verify(inputFile, keyFile string, feature Feature) (*Result, error) {
if len(inputBytes) == 0 {
return nil, fmt.Errorf("input file is empty")
}
inputStr := string(inputBytes)
inputStr := strings.TrimSpace(string(inputBytes))

fmt.Printf("Successfully read input file. Content length: %d bytes\n", len(inputBytes))

Expand Down Expand Up @@ -87,7 +89,14 @@ func VerifyCOSECredential(credStr string, key jwk.Key) (*Result, error) {
}

func VerifySDJWTCredential(credStr string, key jwk.Key) (*Result, error) {
return nil, nil
cred, err := sdjwt.VerifyVerifiableCredential(credStr, key)
if err != nil {
return &Result{Result: Failure, Data: fmt.Sprintf("error verifying SD-JWT credential: %v", err)}, nil
}
if cred == nil {
return &Result{Result: Failure, Data: "SD-JWT credential is invalid"}, nil
}
return &Result{Result: Success}, nil
}

func VerifyJOSEPresentation(presStr string, key jwk.Key) (*Result, error) {
Expand Down Expand Up @@ -117,5 +126,12 @@ func VerifyCOSEPresentation(presStr string, key jwk.Key) (*Result, error) {
}

func VerifySDJWTPresentation(presStr string, key jwk.Key) (*Result, error) {
return nil, nil
pres, err := sdjwt.VerifyVerifiablePresentation(presStr, key)
if err != nil {
return &Result{Result: Failure, Data: fmt.Sprintf("error verifying SD-JWT presentation: %v", err)}, nil
}
if pres == nil {
return &Result{Result: Failure, Data: "SD-JWT presentation is invalid"}, nil
}
return &Result{Result: Success}, nil
}
1 change: 1 addition & 0 deletions tests/input/credential-minimal-cose-signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0oRYVqQBJgNuYXBwbGljYXRpb24vdmMEWCs3M3ZvTVhGTm1ObE9FcHVZQ1NKbGg4ZU4wZHNjeWtvTzZnQnVrZ1JTMXVVEHNhcHBsaWNhdGlvbi92Yytjb3NloFkB8nsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnL25zL2NyZWRlbnRpYWxzL3YyIiwiaHR0cHM6Ly93d3cudzMub3JnL25zL2NyZWRlbnRpYWxzL2V4YW1wbGVzL3YyIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJFeGFtcGxlQWx1bW5pQ3JlZGVudGlhbCJdLCJpZCI6Imh0dHA6Ly91bml2ZXJzaXR5LmV4YW1wbGUvY3JlZGVudGlhbHMvMTg3MiIsImlzc3VlciI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwidmFsaWRGcm9tIjoiMjAxMC0wMS0wMVQxOToyMzoyNFoiLCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgYW5kIEFydHMiLCJ0eXBlIjoiQmFjaGVsb3JEZWdyZWUifSwiaWQiOiJkaWQ6ZXhhbXBsZToxMjMifSwiY3JlZGVudGlhbFNjaGVtYSI6eyJpZCI6Imh0dHBzOi8vZXhhbXBsZS5vcmcvZXhhbXBsZXMvZGVncmVlLmpzb24iLCJ0eXBlIjoiSnNvblNjaGVtYSJ9fVhAs3W1WN83yVu/HoEyYMy7Tcmub9zL55PDnfcx5yG42BTe0gdQ+E0V9B3B1gMZyt9dDEGZVJynd8vztWVr7d4Kkw
1 change: 1 addition & 0 deletions tests/input/credential-nested-selective-signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFUzUxMiIsImN0eSI6InZjIiwia2lkIjoiS1FzaWh4UC1MVGVUWk8yRVRFZmR1UDE1M1VCSWlGUmhJOG5Ta2xNU21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P50nQg8w_wO4IkwAUy1TfybqfU00Y4nCjQ6l_kpXhQpBlXyOXsF4wv1I~WyJCU1h4NUg5S2JZZHA4N3dwQ3BiRFBBIiwic3RyZWV0IiwiMTIzIE1haW4gU3QiXQ~WyJvQU00emxpUk5vTmgzYm4tZmZoZWh3IiwiY2l0eSIsIkFueXRvd24iXQ~WyI2SnRERlM2UWxGRDN3MXZKWUpzSm5nIix7Im51bWJlciI6IisxLTU1NS0xMjMtNDU2NyIsInR5cGUiOiJ3b3JrIn1d~
1 change: 1 addition & 0 deletions tests/input/credential-selective-signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFUzM4NCIsImN0eSI6InZjIiwia2lkIjoiOTZxQm5EcHZTNng4WVNDSF94bW5MbFhaTWtEaEhCcjhsajk5dTVhb2c3cyIsInR5cCI6InZjK3NkLWp3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiX3NkIjpbImtuYzN2Z2pmZlpUUDdwRHk2OVAxVndOV1RGVFhxblg1b0R1Nl9wU2RTYzAiLCIxeElDZkE3Z3VLVXZwU3F6RF9TelhwTU55U1RyWVRDSWNwNEwxOU1YdnFzIl0sImJpcnRoRGF0ZSI6IjE5OTAtMDEtMDEiLCJpZCI6ImRpZDpleGFtcGxlOmViZmViMWY3MTJlYmM2ZjFjMjc2ZTEyZWMyMSJ9LCJpYXQiOiIyMDI0LTAxLTAxVDAwOjAwOjAwWiIsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwiaXNzdWVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiSWRlbnRpdHlDcmVkZW50aWFsIl0sInZhbGlkRnJvbSI6IjIwMjQtMDEtMDFUMDA6MDA6MDBaIn0.bCgz_EgNH5ELRr-xvudGvtIWMQxobkjKLnQer3iXV3iZk4_vKpMG8hUzvrrWlcpoxJo-Dh_Usm8LYcFOdnCHXdVNlnfz8baLEvNRcUc-60NkEwD739qjbEEvrCnYY9jb~WyI0bUZLME14VEsyRmluZFNxQ0ktSzhBIiwiZmlyc3ROYW1lIiwiSmFuZSJd~WyJvU3lzbndsZ1ZGREUzZzdsbTJKZFZRIiwibGFzdE5hbWUiLCJEb2UiXQ~
4 changes: 2 additions & 2 deletions tests/input/presentation-multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
],
"id": "urn:uuid:3978344f-8596-4c3a-a978-8fcaba3903c5",
"type": ["VerifiablePresentation"],
"holder": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"holder": "https://example.issuer/vc-jose-cose",
"verifiableCredential": [
{
"@context": "https://www.w3.org/ns/credentials/v2",
Expand All @@ -23,4 +23,4 @@
"id": "data:application/vc+cose;base64,0oRDoQEm..."
}
]
}
}
1 change: 1 addition & 0 deletions tests/input/presentation-selective-signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFUzM4NCIsImN0eSI6InZwIiwia2lkIjoiOTZxQm5EcHZTNng4WVNDSF94bW5MbFhaTWtEaEhCcjhsajk5dTVhb2c3cyIsInR5cCI6InZwK3NkLWp3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiX3NkIjpbImlVUmIxeHNTUWI0TU1PSktGWUkwSmNWMHRxcWNJSXkxWTRHOHVkdFN5TGciXSwiaWQiOiJ1cm46dXVpZDozOTc4MzQ0Zi04NTk2LTRjM2EtYTk3OC04ZmNh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& 0 deletions tests/input/presentation-selective.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"id": "urn:uuid:3978344f-8596-4c3a-a978-8fcaba3903c5",
"type": ["VerifiablePresentation"],
"holder": "https://example.issuer/vc-jose-cose",
"verifiableCredential": [{
"@context": "https://www.w3.org/ns/credentials/v2",
"type": "EnvelopedVerifiableCredential",
"id": "data:application/vc+sd-jwt,eyJhbGciOiJFUzM4NCIsImN0eSI6InZjIiwia2lkIjoiOTZxQm5EcHZTNng4WVNDSF94bW5MbFhaTWtEaEhCcjhsajk5dTVhb2c3cyIsInR5cCI6InZjK3NkLWp3dCJ9.eyJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvdjIiLCJodHRwczovL3d3dy53My5vcmcvbnMvY3JlZGVudGlhbHMvZXhhbXBsZXMvdjIiXSwiY3JlZGVudGlhbFN1YmplY3QiOnsiX3NkIjpbIjVQTk5EV0VPcmhIYUl1R19TUWpvb3B4ODVIdGNKVmZ0dk9nUG1LYmdyLTQiLCI5ZnZJTWZzV1pDTUM3V2sxN2RadjFFSExEZ1ZtOExtaDFOdzI3Z0k5aEJjIl0sImJpcnRoRGF0ZSI6IjE5OTAtMDEtMDEiLCJpZCI6ImRpZDpleGFtcGxlOmViZmViMWY3MTJlYmM2ZjFjMjc2ZTEyZWMyMSJ9LCJpYXQiOiIyMDI0LTAxLTAxVDAwOjAwOjAwWiIsImlzcyI6Imh0dHBzOi8vZXhhbXBsZS5pc3N1ZXIvdmMtam9zZS1jb3NlIiwiaXNzdWVyIjoiaHR0cHM6Ly9leGFtcGxlLmlzc3Vlci92Yy1qb3NlLWNvc2UiLCJ0eXBlIjpbIlZlcmlmaWFibGVDcmVkZW50aWFsIiwiSWRlbnRpdHlDcmVkZW50aWFsIl0sInZhbGlkRnJvbSI6IjIwMjQtMDEtMDFUMDA6MDA6MDBaIn0.ED7xVJQXpcQfkO6zcjgbdWRVtczUZV1x3Kc-KbPmOX2qsSpPaS4_p52uDCzBIKI45OHTfsIqqcFYVhhK0KHrU6yTMXEXN9bZ-6mlbqPaBHkeEdINhRry8kjVPW8X8eOy~WyIwWm9WNGV5dDFQbHhPdmRSQlhLaW13IiwiZmlyc3ROYW1lIiwiSmFuZSJd~WyJsd0s2WEVodXNiaHpCak54aTBIZm53IiwibGFzdE5hbWUiLCJEb2UiXQ~"
}]
}
1 change: 1 addition & 0 deletions tests/input/presentation-single-cose-signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0oRYV6QBOCIDbmFwcGxpY2F0aW9uL3ZwBFgrOTZxQm5EcHZTNng4WVNDSF94bW5MbFhaTWtEaEhCcjhsajk5dTVhb2c3cxBzYXBwbGljYXRpb24vdnArY29zZaBZAbx7IkBjb250ZXh0IjpbImh0dHBzOi8vd3d3LnczLm9yZy9ucy9jcmVkZW50aWFscy92MiIsImh0dHBzOi8vd3d3LnczLm9yZy9ucy9jcmVkZW50aWFscy9leGFtcGxlcy92MiJdLCJ0eXBlIjoiVmVyaWZpYWJsZVByZXNlbnRhdGlvbiIsImlkIjoidXJuOnV1aWQ6Mzk3ODM0NGYtODU5Ni00YzNhLWE5NzgtOGZjYWJhMzkwM2M1IiwiaG9sZGVyIjoiZGlkOmV4YW1wbGU6ZWJmZWIxZjcxMmViYzZmMWMyNzZlMTJlYzIxIiwidmVyaWZpYWJsZUNyZWRlbnRpYWwiOlt7IkBjb250ZXh0IjoiaHR0cHM6Ly93d3cudzMub3JnL25zL2NyZWRlbnRpYWxzL3YyIiwidHlwZSI6IkVudmVsb3BlZFZlcmlmaWFibGVDcmVkZW50aWFsIiwiaWQiOiJkYXRhOmFwcGxpY2F0aW9uL3ZjK2p3dCxleUpoYkdjaU9pSkZVekkxTmlKOS5leUpwYzNNaU9pSmthV1E2WlhoaGJYQnNaVG94TWpNaWZRLi4uLiJ9XX1YYOPYT1TOFk/HUOD4uVInr7h/fPS1HVj/2OSddBOnsz9eJdHXWRyR2CqI2SixwLRp7WlPOT6wfYo6pf07XK/Yc7ODva+5KzRx3hluriTOWhUdCUG5cn8oIOYG1KHJ347/eQ
4 changes: 2 additions & 2 deletions tests/input/presentation-single.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
],
"id": "urn:uuid:3978344f-8596-4c3a-a978-8fcaba3903c5",
"type": ["VerifiablePresentation"],
"holder": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"holder": "https://example.issuer/vc-jose-cose",
"verifiableCredential": [{
"@context": "https://www.w3.org/ns/credentials/v2",
"type": "EnvelopedVerifiableCredential",
"id": "data:application/vc+jwt,eyJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJkaWQ6ZXhhbXBsZToxMjMifQ...."
}]
}
}
Loading

0 comments on commit 7d5b686

Please sign in to comment.