public function verificaValidade($pathXmlFile = '', &$aRetorno = array())
{
$aRetorno = array();
if (!file_exists($pathXmlFile)) {
$msg = "Arquivo não localizado!!";
throw new Exception\InvalidArgumentException($msg);
}
//carrega a NFe
$xml = Files\FilesFolders::readFile($pathXmlFile);
$this->oCertificate->verifySignature($xml, 'infNFe');
//obtem o chave da NFe
$docnfe = new Dom();
$docnfe->loadXMLFile($pathXmlFile);
$tpAmb = $docnfe->getNodeValue('tpAmb');
$chNFe = $docnfe->getChave('infNFe');
$this->sefazConsultaChave($chNFe, $tpAmb, $aRetorno);
if ($aRetorno['cStat'] != '100' && $aRetorno['cStat'] != '150') {
return false;
}
return true;
}