validatedid / eidas-bridge

This repo contains an implementation of an eIDAS Bridge Library in Python.
Apache License 2.0
11 stars 5 forks source link

Needed two method functionalities for eidas_verify_credential #6

Open iamtxena opened 5 years ago

iamtxena commented 5 years ago

eIDAS API function eidas_verify_credential should work on two ways:

1. No support for DID resolution. In an initial and simpler phase, eIDAS library will delegate the DID resolution to the Agent, making the library simpler and completely independent of the DID-method used. In this scenario the API function will need the DID Document and the function will be as shown:

def eidas_verify_credential(json_credential, did_document) -> str:

The algorithm in this case would be as followed:

  1. Get DID from the json_credential and from did_document and check are the same
  2. Get EIDASLink service endpoint from did_document
  3. Retrieve the EIDAS Link json structure and check that the DID correspond to the one from did_document
  4. Verify signature with the public key of the EIDAS Link and the proof that contains
  5. Return VALID

2. Support for DID Resolution. In this case, the DID resolution would be responsibility for the eIDAS Library and it will not be necessary to include the DID Document as a parameter.

def eidas_verify_credential(json_credential, did_document = None) -> str:

The algorithm in this case will add one additional step:

  1. Get DID from the json_credential
  2. Resolve the DID and obtain the DID Document (using Universal Resolver component)
  3. Get EIDASLink service endpoint from did_document
  4. Retrieve the EIDAS Link json structure and check that the DID correspond to the one from did_document
  5. Verify signature with the public key of the EIDAS Link and the proof that contains
  6. Return VALID