GSMA-CPAS / BWRP-chaincode

Apache License 2.0
1 stars 0 forks source link

implement VerifySignatures #23

Closed sschulz-t closed 3 years ago

sschulz-t commented 3 years ago

This PR exposes a VerifySignatures(msp, documentID, document) (query) function.

The idea is that this function can be called externally in order to verify all signatures stored on the ledger. It fetches the list of stored signatures based on the storage key based on the msp and the documentID. Those signatures are then verified against the given document.

Example output (go test -run TestExchangeAndSigning): ...

{
  "ORG1:eb124a1e-4bd4-43aa-9544-0d48d0a527cc": {
    "signature": "MGUCMBhLzF8ZgPjdgdObllN2eQwyhv9hhsozFxz2s+tUPmAddLLl8EvnO4wfXAt/KSGCiAIxAMNfGm3go3HTzMdKKxIByZN9XlF3Us10Moih386onGRK+vii+hbjo3c+NttyPuQ/9A==",
    "timestamp": "2020-12-16T10:10:43.1895151Z",
    "valid": "true"
  }
} 

This is WIP, details need to be discussed. I will create a PR for the Blockchainadapter in order to expose this functionality next.

Changelog:

sschulz-t commented 3 years ago

deprecated, superseeded and resolved by https://github.com/GSMA-CPAS/BWRP-chaincode/pull/31