This blog post follows on from my previous one signing and verifying files with GnuPG, whereby I showed (he says), in its simplest form, how one can digitally sign and verify a document. This in turn allows anyone reading the document to verify whether or not it has been tampered with since it was signed.

In this post I will describe two methods of linking to a digital signature from a RDF document. The RDF document I will be describing in this post is a FOAF document, but is is needless to say that this approach can be used from any RDF file.

The method described below makes use of the Web of Trust ontology (WOT). WOT allows for RDF documents to be signed using Digital Signatures and Public Key Cryptography.

Whilst putting together the foaf validator, which checks the semantics of a RDF document to ensure that it is a well formed foaf:PersonalProfileDocument, I came across these two different methods of using the Web of Trust ontology.

Linking to an armored digital signature using the WOT ontology from your FOAF file:

Step 0: Declare the wot namespace in the FOAF file



@prefix wot: <http://xmlns.com/wot/0.1/> .

Step 1

Add a triple from the Document pointing to the digital signature like so:



<> wot:assurance <http://foo.com/foaf.rdf.asc> .

Step 2

Add a triples associating the public key used to sign the FOAF document to the FOAF person. This can be done in one of two ways, like so:

Style 1



_:bnode0 a <http://xmlns.com/wot/0.1/PubKey> .
_:bnode0 dc:title “Public Key Bnode” .
_:bnode0 wot:fingerprint “FW89F7WF78SD8F7SD7FG21JL213192” .
_:bnode0 wot:hex_id “12A75E9B” .
_:bnode0 wot:identity <#me> .
_:bnode0 wot:pubkeyAddress <http://foo.com/me.pubkey.asc>

This is how I sign my FOAF file

Style 2



<#me> wot:hasKey _:bnode0 .
_:bnode0 a <http://xmlns.com/wot/0.1/PubKey> .
_:bnode0 wot:pubkeyAddress <http://foo.com/me.pubkey.asc>
_:bnode0 dc:title “Public Key Bnode” .
_:bnode0 wot:fingerprint “FW89F7WF78SD8F7SD7FG21JL213192” .
_:bnode0 wot:hex_id “12A75E9B” .

This is how Kjetil signs his FOAF file

These two methods of associating a publicKey to a FOAF WebID, which is in turn can be used to digitally sign a FOAF file are both supported by Garlik’s FOAF validator.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.