-
Notifications
You must be signed in to change notification settings - Fork 15
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
Ontology for the KeyId document #156
Comments
Is this essentially a request for new vocabulary? I would be happy to review any changes to the security vocab that would make it useful for solid. Let me know how I can help. |
Hi @OR13. I can't quite tell if I need a new vocabulary item, as i am having trouble parsing the examples from the spec. (see issue 93 in the security-vocab). All I need for the moment is to express something along the lines of what I expressed above for RSA keys, to say that I have a signing key that links to an RSA cryptographic key, to be used with SHA512. Is there a way to express that using the security vocabulary? That would allow me to try out HttpSig authentication on my server and start adding WAC authorization built around that. |
Ok @OR13. I found that the Titanium JSON-LD parser works with the security vocabulary (see issue 93 above). {
"@context": [
"https://w3id.org/security/v1",
{ "ex": "http://example.org/vocab#" }
],
"id": "#hs",
"controller": "/people/henry#i",
"publicKeyJwk": {
"kty": "RSA",
"n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
"e":"AQAB",
"alg":"PS512",
"kid":"2011-04-29"
}
} The algorithm PS512 is defined in RFC 7518 and I think is the same as the RSASSA-PSS referred to in Signing HTTP Messages with SHA512 hash. (which seems to be confirmed by the registry entry at the end of RFC7518). The above JSON-LD converts to the following Turtle when fetched from @prefix security <https://w3id.org/security#> .
</keys#hs>
security:controller </people/henry#i> ;
security:publicKeyJwk """{
"alg":"PS512",
"e":"AQAB",
"kid":"2011-04-29",
"kty":"RSA",
"n":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78L..."
}"""^^rdfs:JSON . (it looks like the Titanium parser reordered the json fields). The JSON comes from Appendix A of RFC7517 after replacing the I don't know if I need to describe the type of </keys#hs>. Perhaps this is all we need for RSA keys to work with HttpSig? The algorithm for the Http Signature Verifier Agent would then be for a
|
@bblfish In the did:jwt draft I wrote, I use the alg id to tell the recipient what the remaining public key parameters are. Together these become the jwt kid (they are the public key). As new crypto algorithms are invented, then the JWT group will define new alg identifiers. So "n": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx
4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSocBJECPebWKRXjBZCiFV4n3oknjhMs
tn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2
QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbI
SD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-GxBniIqb
w0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
"e":"AQAB",
"alg":"RS256"
and for EC256 is:
"x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
"y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
"alg":"ES256" these are simply base64 encoded and follow did:jwt. No canonicalisation is needed. |
thats because you are using base64 of json as canonicalization... I imagine the costs of this approach will become untenable for very large credentials... as we have already seen for JWT elsewhere... https://developer.okta.com/blog/2017/08/17/why-jwts-suck-as-session-tokens#size Regarding the other points regarding OWL, I am sure @dmitrizagidulin will be happy to comment on this... I have lost the will to continue to advocate for a coherent approach to the security vocab and owl after these mega threads: |
Thanks for those pointers. Interesting conversation on OWL. I can feel and urge to commenting on those, but I have some deadlines... :-/ Note, I did spend quite a lot of time on the subject a while back with the cert ontology. I think I am going to get going with the dereferenceable keyID returning a graph in whatever serialization that MUST contain a </keys#hs>
security:publicKeyJwk """{
"alg":"PS512",
"e":"AQAB",
"kid":"2011-04-29",
"kty":"RSA",
"n":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78L..."
}"""^^rdfs:JSON |
another related link for future readers... https://docs.joinmastodon.org/spec/security/
|
I have gathered all the definitions for the security vocabulary that I could help to work this out in this issue solid/authorization-panel#225 |
Research space to find ontologies that could be used for the Http Signatures proposal.
There is the 13 year old Cert Ontology from 2008 that has enough info to encode RSA keys. It could be developed further.
There is the security vocabulary by @msporny, @OR13 and @mattcollier.
We will need an ontology to express keys + extra data for the
keyId
Document. See the thread on the Credentials Mailing List. ThekeyId
URL could be its own document but it could also be a pointer into a larger RDF document, e.g. a WebID profile, a document containing any number of keys, etc... It could have extra information about expiry dates, encryption functions, etc...The minimum required by the "Signing Http Messages" IETF HttpBis spec
hs2019
protocol is that thekeyId
point not just to a cryptographic key, but to a key + metadata info. Something like this:This could then be referred to in an HTTP request like this:
The text was updated successfully, but these errors were encountered: