Copyright © 2003 GlobalMentor, Inc. This specification may be freely used and copied, but only in unmodified form.
The Cryptography Ontology (Crypto) specifies a consistent set of RDF classes and properties to use to specify encryption-related information in an RDF instance. Crypto is derived in part from the W3C "XML Encryption Syntax and Processing" and "XML-Signature Syntax and Processing" specifications. (TODO cite)
This is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use this draft as reference material or to cite it as other than "work in progress".
This section is informative.
[XMLENC] (TODO: cite) provides several short examples of encoding character data within an XML info set. Two of these have been combined below into a single non-normative example of XML encryption:
<?xml version='1.0'?> <PaymentInfo xmlns='http://example.org/paymentv2'> <Name>John Smith</Name> <CreditCard Limit='5,000' Currency='USD'> <Number> <EncryptedData xmlns='http://www.w3.org/2001/04/xmlenc#' Type='http://www.w3.org/2001/04/xmlenc#Content'> <EncryptionMethod Algorithm='http://www.w3.org/2001/04/xmlenc#tripledes-cbc'/> <ds:KeyInfo xmlns:ds='http://www.w3.org/2000/09/xmldsig#'> <ds:KeyName>John Smith</ds:KeyName> </ds:KeyInfo> <CipherData> <CipherValue>A23B45C56</CipherValue> </CipherData> </EncryptedData> </Number> <Issuer>Example Bank</Issuer> <Expiration>04/02</Expiration> </CreditCard> </PaymentInfo>
An RDF instance containing the same information might be constructed as in the following non-normative example, which encodes the same information as an RDF plain literal:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:crypto="http://globalmentor.com/namespaces/2003/crypto#" > <PaymentInfo xmlns='http://example.org/paymentv2'> <name>John Smith</name> <method> <CreditCard> <limit> <rdf:value>5,000</rdf:value> <currency>USD</currency> <number rdf:parseType="Resource"> <crypto:algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> <crypto:key> <crypto:Key> <crypto:keyName>John Smith</crypto:keyName> </crypto:Key>> </crypto:key> <crypto:cipherData>A23B45C56</crypto:cipherData> </number> </limit> <issuer>Example Bank</issuer> <expiration>04/02</expiration> </CreditCard> </method> </PaymentInfo> </rdf:RDF>
Several points can be made about the differences between [XMLENC] (TODO: cite) and Crypto:
Type
attribute in the above example: the Crypto properties apply to the object resource of the example number
property.Crypto can also be used to specify encoding information for resources with content outside the RDF instance, such as in the following non-normative example:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:crypto="http://globalmentor.com/namespaces/2003/crypto#" xmlns:xpackage="http://xpackage.org/namespaces/2003/xpackage#" xmlns:mime="http://xpackage.org/namespaces/2003/mime#" xmlns:xlink="http://www.w3.org/1999/xlink"> > <rdf:Description> <xpackage:location xlink:type="simple" xlink:href="image.png"> <mime:contentType>image/png</mime:contentType> <crypto:algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> <crypto:key> <crypto:Key> <crypto:keyName>Secret Key</crypto:keyName> <crypto:keyValue> <crypto:RSAKeyValue> <crypto:modulus>xA7SEU+e0yQH5rm9kbCDN9o3aPIo7HbP7tX6WOocLZAtNfyxSZDU16ksL6W jubafOqNEpcwR3RdFsT7bCqnXPBe5ELh5u4VEy19MzxkXRgrMvavzyBpVRgBUwUlV 5foK5hhmbktQhyNdy/6LpQRhDUDsTvK+g9Ucj47es9AQJ3U=</crypto:modulus> <crypto:exponent>AQAB</crypto:exponent> </crypto:RSAKeyValue> </crypto:Key>> </crypto:key> <rdf:Description> </rdf:RDF>
crypto:cipherData
property is not necessary.TODO