DataModel
contains a Proof
that contains all the information of its integrity along with the method with which the Proof
should be verified.
In this case I designed a JWS
type of proof that can be generated by using a ProofGenerator
object that contains the private key to calculate the Proof
. However each time a DataModel
must be verified a public key must be provided by the verifier, which means that the public key (that is the information needed for the verification) is not included into the Proof
.
A possible solution would be to define a new ProofMethod
class that contains all the information to perform the verification and pass it to the verify
method of the Proof
that contains the logic to do that.
Is there a better way to design this mechanism by including all the necessary information in the Proof
class to do the verification knowing that the information needed for that must be provided and not included (in this case the public key) when the Proof
is created?
Another problem is that who receive the DataModel
must recognize the Proof
type otherwise it is not able to provide the ProofMethod
necessary to do the verification.