Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

test/support ability in AFGO to create and parse vc and vp in JWT format #3334

Merged

Conversation

mishasizov-SK
Copy link
Contributor

Signed-off-by: Mykhailo Sizov mykhailo.sizov@securekey.com

Title:
Support ability in AFGO to create and parse vc and vp in JWT format

Description:
Added BDD tests with creating and verifying VC and VP in JWT format.
Solves: #3314

Summary:
Algorithms included:

  • Ed25519
  • ECDSA secp256r1
  • ECDSA secp384r1

Verifier: getVerifier(resolver, VerifyRS256),
},
)
verifiers := []verifier.SignatureVerifier{
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extended the list of default verifiers.

Comment on lines -505 to -541

type docLoaderProvider struct {
ContextStore ldstore.ContextStore
RemoteProviderStore ldstore.RemoteProviderStore
}

func (p *docLoaderProvider) JSONLDContextStore() ldstore.ContextStore {
return p.ContextStore
}

func (p *docLoaderProvider) JSONLDRemoteProviderStore() ldstore.RemoteProviderStore {
return p.RemoteProviderStore
}

func createDocumentLoader() (*ld.DocumentLoader, error) {
contextStore, err := ldstore.NewContextStore(mem.NewProvider())
if err != nil {
return nil, err
}

remoteProviderStore, err := ldstore.NewRemoteProviderStore(mem.NewProvider())
if err != nil {
return nil, err
}

p := &docLoaderProvider{
ContextStore: contextStore,
RemoteProviderStore: remoteProviderStore,
}

loader, err := ld.NewDocumentLoader(p, ld.WithExtraContexts(bddldcontext.Extra()...))
if err != nil {
return nil, err
}

return loader, nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reused the code from github.com/hyperledger/aries-framework-go/test/bdd/pkg/verifiable

@codecov
Copy link

codecov bot commented Aug 15, 2022

Codecov Report

Merging #3334 (046adf0) into main (e05b76b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #3334   +/-   ##
=======================================
  Coverage   88.01%   88.01%           
=======================================
  Files         323      323           
  Lines       44437    44445    +8     
=======================================
+ Hits        39110    39118    +8     
  Misses       3929     3929           
  Partials     1398     1398           
Impacted Files Coverage Δ
pkg/doc/jwt/verifier.go 82.17% <100.00%> (+1.17%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Feature: Issue and verify Verifiable Credential and Verifiable Presentation with JWS proof
@issue_vc_vp_jwt_ed25519
Scenario: Issue VC - verify VC - create VP - verify VP with Ed25519 JWS proof
When "Berkley" issues VC at "2022-04-12" regarding "Master Degree" to "Alice" with "Ed25519" JWS proof
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change from JWS proof to JWS format

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed, pls see

Then "Alice" embeds the VC into VP with "Ed25519" JWS proof
Then "Alice" verifies VP

@issue_vc_vp_jwt_ecdsaSecp256r1
Copy link
Contributor

@fqutishat fqutishat Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@mishasizov-SK mishasizov-SK Aug 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great catch! updated

Signed-off-by: Mykhailo Sizov <mykhailo.sizov@securekey.com>
@mishasizov-SK mishasizov-SK force-pushed the test/create-parse-vp-vc-jwt branch from 7f60a99 to 046adf0 Compare August 15, 2022 15:12
@fqutishat fqutishat merged commit c25152f into hyperledger-archives:main Aug 15, 2022
@mishasizov-SK mishasizov-SK deleted the test/create-parse-vp-vc-jwt branch August 15, 2022 15:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants