xml.Signature.createReference

Creates a new reference that will be signed with the compute() method

Syntax

createReference(
   uri STRING,
   digest STRING )
  RETURNS INTEGER
  1. uri represents the data to be signed.
  2. digest defines a URL as identifier for the hash algorithm.

Usage

The returned value represents the index for any further manipulation of this reference.

The uri can be:

  • An absolute URL such as http://, https://, tcp://, tcps://, file:/// and alias:// (see FGLPROFILE Configuration for more details about URL mapping with aliases), and where the data can be a XML document or any kind of data such as images or HTML pages.

  • NULL to sign the whole document, but only one NULL is allowed in the entire signature.

  • An empty URI (uri=""). In this case, the uri attribute identifies the root element of the XML document containing the reference.

  • A fragment like #tobesigned. Note that a DOM node fragment is identified via the value of an attribute of type ID such as xml:id or any attribute whose type was changed to ID with xml.DomNode.setIdAttribute() or xml.DomNode.setIdAttributeNS().

If the uri attribute is omitted altogether, the receiving application is expected to know the identity of the object.

In case of error, the method throws an exception and sets the status variable. Depending on the error, a human-readable description of the problem is available in the sqlca.sqlerrm register. See Error handling in GWS calls (status).