Exemplo n.º 1
0
 /**
  * Helper method to validate the whole SignedDoc object
  *
  * @param bStrong flag that specifies if Id atribute value is to be rigorously checked (according
  *     to digidoc format) or only as required by XML-DSIG
  * @return a possibly empty list of SignedDocException objects
  */
 public ArrayList<SignedDocException> validate(boolean bStrong) {
   ArrayList<SignedDocException> errs = new ArrayList<SignedDocException>();
   SignedDocException ex = validateFormat(m_format);
   if (ex != null) errs.add(ex);
   ex = validateVersion(m_version);
   if (ex != null) errs.add(ex);
   for (int i = 0; i < countDataFiles(); i++) {
     DataFile df = getDataFile(i);
     ArrayList<SignedDocException> e = df.validate(bStrong);
     if (!e.isEmpty()) errs.addAll(e);
   }
   for (int i = 0; i < countSignatures(); i++) {
     Signature sig = getSignature(i);
     ArrayList<SignedDocException> e = sig.validate();
     if (!e.isEmpty()) errs.addAll(e);
   }
   return errs;
 }