|
|
Implementing the IURIDereferencer interfaceTo validate an XML signature, you must provide an implementation of the IURIDereferencer interface. The implementation is responsible for resolving the URIs within the Reference elements of an XML signature document and returning the data so that the digest can be computed. The computed digest is compared with the digest in the signature to determine if the referenced data has been altered since the signature was created. Note: HTML-based AIR applications must import a SWF library containing
an ActionScript implementation in order to validate XML signatures.
The IURIDereferencer interface cannot be implemented in JavaScript.
The IURIDerefencer interface has a single method, dereference(uri:String), that must be implemented. The XMLSignatureValidator object calls this method for each reference in the signature. The method must return the data in a ByteArray object. In most cases, you will also need to add properties or methods that allow your dereferencer object to locate the referenced data. For example, if the signed data is located in the same document as the signature, you could add a member variable that provides a reference to the XML document. The dereference() method can then use this variable, along with the URI, to locate the referenced data. Likewise, if the signed data is located in a directory of the local file system, the dereference() method might need a property providing the path to that directory in order to resolve the referenced files. The XMLSignatureValidator relies entirely on the dereferencer for interpreting URI strings. The standard rules for dereferencing URIs are given in the section 4.3.3 of the W3C Recommendation for XML Signature Syntax and Processing. |