Signing methods
Given an RDF::Trine::Model, returns a signature as a string. The model is converted to a canonicalised N-Triples representation (see RDF::Trine::Serializer::NTriples::Canonical) with any triples that cannot be canonicalised being truncated. This representation is then signed using an \s-1MD5\s0 digest, and the resulting binary signature encoded using base64. Given a WebID that people can use to recover your public key, and a list of URLs that need signing, signs each and returns an RDF::Trine::Model containing the results of processing. This can be serialised as, say, Turtle to act as an endorsement for a bunch of \s-1RDF\s0 graphs. Parses the given Turtle into a model, generates a signature for that and then returns the original Turtle with the signature embedded as a comment. This allows the signature to sit in the same file as the data itself. The base \s-1URI\s0 is used to resolve any relative \s-1URI\s0 references. Note that if a different base \s-1URI\s0 is provided when verifying the signature, this may cause verification to fail. The base \s-1URI\s0 is optional. As per \*(C`sign_embed_turtle\*(C', but \s-1RDF/XML\s0. Similar to \*(C`sign_embed_turtle\*(C' and \*(C`sign_embed_rdfxml\*(C'. The base \s-1URI\s0 is required. A set of configuration options may be provided, which will be passed along to RDF::RDFa::Parser's constructor. Rather than storing the signature as an \s-1XML/HTML\s0 comment, the signature is stored on the root element as an attribute. Signs a literal string which may or may not have anything to do with \s-1RDF\s0.
This role does not implement these methods, but requires classes to implement them instead: Generates a signature for an octet string. Returns a string used as a marker for signatures within serialised \s-1RDF\s0.
RDF::Crypt, RDF::Crypt::Signer.
Please report any bugs to <http://rt.cpan.org/>.
Toby Inkster <[email protected]>.
Copyright 2010, 2012 Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.