Skip to content

Commit

Permalink
feat: sdjwt exclude system keys (#1429)
Browse files Browse the repository at this point in the history
  • Loading branch information
skynet2 authored Sep 18, 2023
1 parent c99658f commit 94cb37d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/doc/vc/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ func (c *Crypto) signCredentialJWT(
options := []verifiable.MakeSDJWTOption{
verifiable.MakeSDJWTWithHash(signerData.SDJWT.HashAlg),
verifiable.MakeSDJWTWithVersion(signerData.SDJWT.Version),
verifiable.MakeSDJWTWithNonSelectivelyDisclosableClaims([]string{"id", "type", "@type"}),
}

return c.getSDJWTSignedCredential(credential, s, jwsAlgo, method, options...)
Expand Down
4 changes: 3 additions & 1 deletion pkg/internal/testutil/credential.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ func proveVC(

joseSigner := jws.NewSigner(didDoc.VerificationMethod[0].ID, jwsAlgName, suite.NewCryptoSigner(customCrypto, kh))

sdjwtCredential, err := credential.MakeSDJWT(joseSigner, didDoc.VerificationMethod[0].ID)
sdjwtCredential, err := credential.MakeSDJWT(joseSigner, didDoc.VerificationMethod[0].ID,
verifiable.MakeSDJWTWithNonSelectivelyDisclosableClaims([]string{"id", "type", "@type"}),
)
require.NoError(t, err)

vcParsed, err := verifiable.ParseCredential([]byte(sdjwtCredential),
Expand Down

0 comments on commit 94cb37d

Please sign in to comment.