protected void ensureUnsignedProperties() throws DSSException {
  final NodeList qualifyingPropertiesNodeList=currentSignatureDom.getElementsByTagNameNS(XAdESNamespaces.XAdES,"QualifyingProperties");
  if (qualifyingPropertiesNodeList.getLength() != 1) {
    throw new DSSException("The signature does not contain QualifyingProperties element (or contains more than one)! Extension is not possible.");
  }
  qualifyingPropertiesDom=(Element)qualifyingPropertiesNodeList.item(0);
  final NodeList unsignedPropertiesNodeList=currentSignatureDom.getElementsByTagNameNS(XAdESNamespaces.XAdES,"UnsignedProperties");
  final int length=unsignedPropertiesNodeList.getLength();
  if (length == 1) {
    unsignedPropertiesDom=(Element)qualifyingPropertiesNodeList.item(0);
  }
 else   if (length == 0) {
    unsignedPropertiesDom=DSSXMLUtils.addElement(documentDom,qualifyingPropertiesDom,XAdESNamespaces.XAdES,"xades:UnsignedProperties");
  }
 else {
    throw new DSSException("The signature contains more then one UnsignedProperties element! Extension is not possible.");
  }
}

protected void ensureUnsignedProperties ( ) throws DSSException { final NodeList qualifyingPropertiesNodeList = currentSignatureDom . getElementsByTagNameNS ( XAdESNamespaces . XAdES , "QualifyingProperties" ) ; if ( qualifyingPropertiesNodeList . getLength ( ) != 1 ) { throw new DSSException ( "The signature does not contain QualifyingProperties element (or contains more than one)! Extension is not possible." ) ; } qualifyingPropertiesDom = ( Element ) qualifyingPropertiesNodeList . item ( 0 ) ; final NodeList unsignedPropertiesNodeList = currentSignatureDom . getElementsByTagNameNS ( XAdESNamespaces . XAdES , "UnsignedProperties" ) ; final int length = unsignedPropertiesNodeList . getLength ( ) ; if ( length == 1 ) { unsignedPropertiesDom = ( Element ) qualifyingPropertiesNodeList . item ( 0 ) ; } else if ( length == 0 ) { unsignedPropertiesDom = DSSXMLUtils . addElement ( documentDom , qualifyingPropertiesDom , XAdESNamespaces . XAdES , "xades:UnsignedProperties" ) ; } else { throw new DSSException ( "The signature contains more then one UnsignedProperties element! Extension is not possible." ) ; } }
returns or creates ( if it does not exist ) the unsignedpropertiestype dom object .
