Community articleUFLSignForm function
Added by IBM contributorIBM on August 16, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This function takes a button node and creates a digital signature for that button. The signature is created using the signature filter in the button and the private key of the signer.
This function returns a signature object that is tracked by reference counts. If you do not need to use the object, remember to release the reference to it.


   r_error UFLSignForm(
      formNodeP theButton,
      Certificate *theSigner,
      StringDictionary *theInfo,
      SecurityUserStatusType *theStatus,
      Signature **theSignature


Table 1. Function parameters
theButton formNodePThe form node that represents the signature button.
theSignerCertificate* The certificate to use to create the signature.
theInfoStringDictionary*Always use a NULL value.
theStatusSecurityUserStatusType*This is a status flag that reports whether the operation was successful. Possible values are:
SUSTATUS_OK — the operation was successful.
SUSTATUS_CANCELLED — the operation was cancelled by the user.
SUSTATUS_INPUT_REQUIRED — the operation required user input, but could not receive it (for example, it was run on a server with no user).
theSignature Signature **The signature object that the function creates. Note that this object is tracked by reference counts, and must be released.


OK on success or an error code on failure.


In the following example, UFLDereferenceEx is used to retrieve the node of a specific signature button. UFLSignForm is then used to create a signature object. Since we do not need to use the signature object, we then release the reference count to that object.
   r_error createSignature(formNodeP form, Certificate *theSigner)
   Signature *theSignature;
   SecurityUserStatusType theStatus;
   formNodeP buttonNode;
   r_error error;
      if ((buttonNode = UFLDereferenceEx(form, NULL, "PAGE1.SIGNBUTTON", 
         fprintf(stderr, "Could not locate SIGNBUTTON node.\n");
      if ((error = UFLSignForm(buttonNode, theSigner, NULL, &theStatus, 
         &theSignature)) != OK)
         fprintf(stderr, "UFLSignForm error %hd.\n", error);
      /* Check the status in case the process required user input. */
      if (theStatus != SUSTATUS_OK)
         fprintf(stderr, "User input required to sign form./n");
      /* Release the signature object. */

Parent topic:
FormNodeP functions