-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N3 and Verifiable Claims #204
Comments
Another way of thinking in terms of the logic of saying that. The signed entity is a claim that someone - the issuer- says. The claim must be quoted (as a statement) because it should only be agreed to if the proof accompanying it is verified. |
Here is the result of doing this with Example 1 from the VC Data Model, for which I
$ mvn install -Drat.skip=true one can run a local version of the import org.apache.jen3.rdf.model.Model
import org.apache.jen3.rdf.model.ModelFactory
import org.apache.jen3.sys.JenaSystem
import org.apache.jen3.n3.N3ModelSpec.Types.N3_MEM_FP_INF
import org.apache.jen3.n3.N3ModelSpec
import java.io.FileInputStream
import org.apache.jen3.n3.io.N3JenaWriterFull
val spec = N3ModelSpec.get(N3_MEM_FP_INF)
val m = ModelFactory.createN3Model(spec)
m.read(new FileInputStream(args(0)), null)
m.setNsPrefix("sec","https://w3id.org/security#")
m.setNsPrefix("cred","https://www.w3.org/2018/credentials#")
m.setNsPrefix("eg","https://example.org/examples#")
val wr = new org.apache.jen3.n3.io.N3JenaWriterFull(true)
wr.write(m, System.out, null) with the following command $ scala-cli run -r m2Local --dependency org.apache.jena:jen3-core:3.14.0-SNAPSHOT nqish2n3.sc -- vcdm.ex1.step1.n3 which results in the following easier to read n3 @prefix sec: <https://w3id.org/security#> .
@prefix cred: <https://www.w3.org/2018/credentials#> .
@prefix eg: <https://example.org/examples#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#> .
@prefix in: <http://n3.w3c.org/builtin/input#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix math: <http://www.w3.org/2000/10/swap/math#> .
@prefix list: <http://www.w3.org/2000/10/swap/list#> .
<did:example:c276e12ec21ebfeb1f712ebc6f1>
<http://schema.org/name>
"Exemple d'Université"@fr ;
<http://schema.org/name>
"Example University"@en .
<did:example:ebfeb1f712ebc6f1c276e12ec21>
<http://schema.org/alumniOf>
<did:example:c276e12ec21ebfeb1f712ebc6f1> .
<http://example.edu/credentials/1872>
cred:issuer <https://example.edu/issuers/565049> ;
a eg:AlumniCredential ;
a cred:VerifiableCredential ;
cred:issuanceDate "2010-01-01T19:23:24Z"^^xsd:dateTime ;
cred:credentialSubject
<did:example:ebfeb1f712ebc6f1c276e12ec21> ;
sec:proof {
_:b1 rdf:type sec:RsaSignature2018 .
_:b1 <http://purl.org/dc/terms/created>
"2017-06-18T21:19:10Z"^^xsd:dateTime .
_:b1 sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM" .
_:b1 sec:proofPurpose sec:assertionMethod .
_:b1 sec:verificationMethod
<https://example.edu/issuers/565049#key-1> . } . This again seems to indicate that the signature is wrongly in the context where it should be a blank node, and that some part of the rest of the description should be in an n3 context { ... } namely that part that is being signed. |
I wonder if there is a mistake somewhere in the tool chain or in the modelling of Verifiable Claims.
Using the process described in issue 1 of Jen3 I took the Verfiable Claim Model example 6
and translated it to the following N3
I am doing this for the purpose of modeling access control using the says logic discussed in issue 203.
Anyway: it seems to me, looking at this, that the proof should not be inside the graph of the credential it is signing but outside of it because a signature must be about precisely specified content.
So I would have expected instead:
or something along those lines where it is clear what the signed triples are.
That is, the graph to be signed must be a quoted graph, and the signature proof of it is an external description of that graph.
So it looks like we ended up with the opposite of what is logically needed.
The text was updated successfully, but these errors were encountered: