Community articleverifyAllSignatures method
Added by IBM contributorIBM on August 15, 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 method verifies the correctness of all digital signatures in a given form whose root node is provided. It finds all items of type signature and calls verifySignature for each signature. Errors are logged for all non valid signatures.
This method checks the following conditions for each signature:
  • The signature item contains mimedata.
  • The mimedata contains a hash value and signer certificate.
  • The signer certificate contains the same ID as that recorded in the signature item's signer option.
  • The signer certificate has not expired.


   public short verifyAllSignatures(
      boolean reportAsErrorsFlag
   ) throws UWIException; 


Table 1. Method parameters
reportAsErrorsFlagbooleanSet to true if you want errors about the signatures to be reported by throwing a UWIException, or false if you want the error code to be only returned through the return value.


A short having one of the following values:
Table 2. return codes
FormNodeP.UFL_SIGS_OKThe signatures are valid.
FormNodeP.UFL_SIGS_NOTOKOne or more signatures are broken.
FormNodeP.UFL_SIGS_UNVERIFIEDOne or more signatures are unverifiable.
FormNodeP.UFL_SIGS_VERIFIEDBUTNOTAUTHENTICATEDThis value will only be returned on items that have an HMAC signature. It means that the data is valid, but the shared secret could not be checked for validity.

If one or more of the signatures is not valid and the reportAsErrorsFlag is true, a generic exception (UWIException) is thrown. On error, the method throws a generic exception (UWIException).


In the following example, verifyAllSignatures determines whether or not all the signatures in the form are valid. If one or more of the digital signatures are not valid, an error message is displayed.
   private static void checkSignatures(FormNodeP theForm) throws Exception
      if (theForm.verifyAllSignatures(false) == FormNodeP.UFL_SIGS_OK)
         System.out.println("All the digital signatures are valid.");

Parent topic:
FormNodeP class