JSON (
JavaScript Object Notation)
message integrity is provided using a
digital signature scheme. The
digital signature scheme implements a set of
processing rules for creating and representing digital signatures using a
JSON signature
syntax. The
syntax preferably comprises a set of named elements, including a reference element, a signature
information element, and a signature element. In one embodiment, a
machine-implemented method for signing a
JSON message begins by constructing a reference element for each data object in the JSON message to be signed. The data object is identified by a reference identifier. The reference element includes the reference identifier, a pointer (such as a URI) to a digest method, and a digest generated by applying the digest method to the data object or a given function of the data object. Then, a signature
information element is constructed for one or more of the reference elements corresponding to the one or more
data objects in the message that are being signed. The signature
information element includes a pointer to a signature method, as well as one or more reference elements, or a canonical form of the one or more reference elements. Then, a signature element is constructed. The signature element includes the signature information element, and a signature value generated by applying the signature method (identified in the signature information element) to the signature information element. The signature element is the JSON message signature. The signature enables a sending entity (such as a
Web browser or
Web server) to generate a digest on all or parts of a JSON message and then to secure the digests using a signing key.