{"id":37027925,"url":"https://github.com/wmixvideo/nfe","last_synced_at":"2026-05-20T00:01:54.997Z","repository":{"id":2057083,"uuid":"11797332","full_name":"wmixvideo/nfe","owner":"wmixvideo","description":"Nota Fiscal Eletrônica em Java.","archived":false,"fork":false,"pushed_at":"2026-04-17T19:16:56.000Z","size":22629,"stargazers_count":750,"open_issues_count":1,"forks_count":404,"subscribers_count":131,"default_branch":"master","last_synced_at":"2026-04-17T20:32:27.600Z","etag":null,"topics":["cte","java","mdfe","nfe","sefaz"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wmixvideo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-07-31T17:58:03.000Z","updated_at":"2026-04-17T19:16:59.000Z","dependencies_parsed_at":"2023-07-06T17:46:21.627Z","dependency_job_id":"3ea01cd9-294e-4e3c-86fe-1b1d35bcb2f9","html_url":"https://github.com/wmixvideo/nfe","commit_stats":{"total_commits":1752,"total_committers":113,"mean_commits":"15.504424778761061","dds":0.7425799086757991,"last_synced_commit":"b96f628308362918dda50e9177cce6dce91f7ec4"},"previous_names":["fincatto/nfe"],"tags_count":309,"template":false,"template_full_name":null,"purl":"pkg:github/wmixvideo/nfe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmixvideo%2Fnfe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmixvideo%2Fnfe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmixvideo%2Fnfe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmixvideo%2Fnfe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wmixvideo","download_url":"https://codeload.github.com/wmixvideo/nfe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmixvideo%2Fnfe/sbom","scorecard":{"id":334513,"data":{"date":"2025-07-07","repo":{"name":"github.com/wmixvideo/nfe","commit":"76d3f91dbe90b5c23b161fb6522cc0a9777f0ae3"},"scorecard":{"version":"v5.2.1-18-gbb9c347d","commit":"bb9c347dff6349d986baab6578a46d68a5524c62"},"score":4.8,"checks":[{"name":"Code-Review","score":2,"reason":"Found 8/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#code-review"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:18","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:19","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Warn: no topLevel permission defined: .github/workflows/maven.yml:1","Warn: no topLevel permission defined: .github/workflows/release-tag.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v4.0.91 not signed: https://api.github.com/repos/wmixvideo/nfe/releases/228917058","Warn: release artifact v4.0.90 not signed: https://api.github.com/repos/wmixvideo/nfe/releases/228463055","Warn: release artifact v4.0.89 not signed: https://api.github.com/repos/wmixvideo/nfe/releases/227360711","Warn: release artifact v4.0.88 not signed: https://api.github.com/repos/wmixvideo/nfe/releases/227195120","Warn: release artifact v4.0.87 not signed: https://api.github.com/repos/wmixvideo/nfe/releases/227194471","Warn: release artifact v4.0.91 does not have provenance: https://api.github.com/repos/wmixvideo/nfe/releases/228917058","Warn: release artifact v4.0.90 does not have provenance: https://api.github.com/repos/wmixvideo/nfe/releases/228463055","Warn: release artifact v4.0.89 does not have provenance: https://api.github.com/repos/wmixvideo/nfe/releases/227360711","Warn: release artifact v4.0.88 does not have provenance: https://api.github.com/repos/wmixvideo/nfe/releases/227195120","Warn: release artifact v4.0.87 does not have provenance: https://api.github.com/repos/wmixvideo/nfe/releases/227194471"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:11"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/codeql.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/maven.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/maven.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/maven.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-tag.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release-tag.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-tag.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release-tag.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-tag.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release-tag.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-tag.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release-tag.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-tag.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release-tag.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/wmixvideo/nfe/release.yml/master?enable=pin","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (9) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-hfrx-6qgj-fp6c","Warn: Project is vulnerable to: GHSA-vv7r-c36w-3prj","Warn: Project is vulnerable to: GHSA-3832-9276-x7gf","Warn: Project is vulnerable to: GHSA-78wr-2p64-hpwj","Warn: Project is vulnerable to: GHSA-gwrp-pvrq-jmwv","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-7r82-7xv7-xcpj","Warn: Project is vulnerable to: GHSA-jw7r-rxff-gv24"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/bb9c347dff6349d986baab6578a46d68a5524c62/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T04:24:23.553Z","repository_id":2057083,"created_at":"2025-08-18T04:24:23.554Z","updated_at":"2025-08-18T04:24:23.554Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31945987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cte","java","mdfe","nfe","sefaz"],"created_at":"2026-01-14T03:19:32.576Z","updated_at":"2026-04-17T21:01:24.158Z","avatar_url":"https://github.com/wmixvideo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Nota Fiscal Eletrônica\n===\nComunicador de nota fiscal e nota fiscal do consumidor da [fazenda](http://www.nfe.fazenda.gov.br/portal/principal.aspx).\u003cbr/\u003e\n[![Java CI](https://github.com/wmixvideo/nfe/workflows/Continuous%20Integration/badge.svg)](https://github.com/wmixvideo/nfe/workflows/Java%20CI/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/wmixvideo/nfe/badge.svg?branch=master)](https://coveralls.io/github/wmixvideo/nfe?branch=master)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.wmixvideo/nfe)](https://search.maven.org/artifact/com.github.wmixvideo/nfe)\n[![Apache 2.0 License](https://img.shields.io/badge/license-apache%202.0-green.svg) ](https://github.com/wmixvideo/nfe/blob/master/LICENSE)\n\n## Atenção\nEste é um projeto colaborativo, sinta-se à vontade em usar e colaborar com o mesmo.\u003cbr/\u003e\n\nAntes de submeter um pull request, verifique a estrutura seguida pelo projeto e procure incluir no mesmo testes unitários que garantam que a funcionalidade funciona como o esperado.\n\nPossuímos um grupo de WhatsApp para discussões sobre o desenvolvimento da lib: https://chat.whatsapp.com/LFmqpkoiIYc6Zy3d4TnZGU\n\n## Antes de usar\nAntes de começar a implementar, é altamente recomendável a leitura da documentação oficial que o governo disponibiliza em http://www.nfe.fazenda.gov.br/portal\n\nCaso não possua conhecimento técnico para criar notas fiscais, um profissional da área (como um contador) pode lhe auxiliar.\n\n## Instalação\n\n### Diretamente pelo Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.wmixvideo\u003c/groupId\u003e\n  \u003cartifactId\u003enfe\u003c/artifactId\u003e\n  \u003cversion\u003e${latest.release}\u003c/version\u003e\n\u003c/dependency\u003e\n```\nPara acessar a lista de versões disponíveis, acesse a página de release [aqui](https://github.com/wmixvideo/nfe/releases) no github. \n\n### Diretamente pelo código fonte (última versão em desenvolvimento)\n ```console\n    git clone https://github.com/wmixvideo/nfe\n    mvn clean install\n  ```\n\n## Como usar\nBasicamente você precisará de uma implementação de **NFeConfig** (exemplificado abaixo), com informações de tipo de emissão, certificados\ndigitais, e uma instância da **WsFacade**, essa classe tem a responsabilidade de fazer a ponte entre o seu sistema e a\ncomunicação com os webservices da Sefaz.\n\n```java\n// Exemplo de configuracao para acesso aos serviços da Sefaz.\npublic class NFeConfigTeste extends NFeConfig {\n\n    private KeyStore keyStoreCertificado = null;\n    private KeyStore keyStoreCadeia = null;\n\n    @Override\n    public DFUnidadeFederativa getCUF() {\n        return DFUnidadeFederativa.SC;\n    }\n\n    @Override\n    public String getCertificadoSenha() {\n        return \"senha_certificado\";\n    }\n\n    @Override\n    public String getCadeiaCertificadosSenha() {\n        return \"senha_cadeia\";\n    }\n\n    @Override\n    public KeyStore getCertificadoKeyStore() throws KeyStoreException {\n        if (this.keyStoreCertificado == null) {\n            this.keyStoreCertificado = KeyStore.getInstance(\"PKCS12\");\n            try (InputStream certificadoStream = new FileInputStream(\"/tmp/certificado.pfx\")) {\n                this.keyStoreCertificado.load(certificadoStream, this.getCertificadoSenha().toCharArray());\n            } catch (CertificateException | NoSuchAlgorithmException | IOException e) {\n                this.keyStoreCadeia = null;\n                throw new KeyStoreException(\"Nao foi possibel montar o KeyStore com a cadeia de certificados\", e);\n            }\n        }\n        return this.keyStoreCertificado;\n    }\n\n    @Override\n    public KeyStore getCadeiaCertificadosKeyStore() throws KeyStoreException {\n        if (this.keyStoreCadeia == null) {\n            this.keyStoreCadeia = KeyStore.getInstance(\"JKS\");\n            try (InputStream cadeia = new FileInputStream(\"/tmp/cadeia.jks\")) {\n                this.keyStoreCadeia.load(cadeia, this.getCadeiaCertificadosSenha().toCharArray());\n            } catch (CertificateException | NoSuchAlgorithmException | IOException e) {\n                this.keyStoreCadeia = null;\n                throw new KeyStoreException(\"Nao foi possibel montar o KeyStore com o certificado\", e);\n            }\n        }\n        return this.keyStoreCadeia;\n    }\n}\n```\n### Configurar pelo repositório de certificados do Windows:\n\n#### Carregando os alias disponíveis(certificados instalados) no Windows:\n```java\nKeyStore keyStoreCert = KeyStore.getInstance(\"Windows-MY\", \"SunMSCAPI\"); \nkeyStoreCert.load(null, null);\nEnumeration\u003cString\u003e aliasEnum = keyStoreCert.aliases();\n```\n\nApós isso é necessário algum método para o usuário escolher entre um destes alias, \ntalvez por meio de um JOptionPane(\u003cjava7)\n ou de um ChoiceDialog\u003cString\u003e(\u003e=Java8), e então fazer o load com a respectivo alias escolhido e sua senha.\n\n### Alguns exemplos\nConsidere para os exemplos abaixo que **config** seja uma instância da implementação da interface **NFeConfig**.\n\n#### Status dos webservices\n```java\nNFStatusServicoConsultaRetorno retorno = new WSFacade(config).consultaStatus(DFUnidadeFederativa.SC, DFModelo.NFE);\nSystem.out.println(retorno.getStatus());\nSystem.out.println(retorno.getMotivo());\n```\n\nO Resultado será (caso o webservice responsável por SC esteja OK):\n```\n107\nServico em operacao\n```\n\n#### Envio do lote para o sefaz\nPopule os dados do lote a ser enviado para o Sefaz:\n\n```java\nNFLoteEnvio lote = new NFLoteEnvio();\n// setando os dados do lote\n```\n\nFaça o envio do lote através do facade:\n```java\nfinal NFLoteEnvioRetorno retorno = new WSFacade(config).enviaLote(lote);\n```\n\n#### Corrige nota\nFaça a correção da nota através do facade:\n```java\nfinal NFEnviaEventoRetorno retorno = new WSFacade(config).corrigeNota(chaveDeAcessoDaNota, textoCorrecao, sequencialEventoDaNota);\n```\n\n#### Cancela nota\nFaça o cancelamento da nota através do facade:\n```java\nfinal NFCancelamentoRetornoDados retorno = new WSFacade(config).cancelaNota(chaveDeAcessoDaNota, protocoloDaNota, motivoCancelaamento);\n```\n\n#### Consulta nota por chave de acesso ou NSU\nFaça a consulta da nota através do facade:\n```java\nfinal NFDistribuicaoIntRetorno retorno = new WSFacade(config).consultarDistribuicaoDFe(cnpj, uf, chaveAcesso, nsu, ultNsu);\n```\n\n#### Consulta CTe\nFaça a consulta do CTe através do CTDistribuicaoInt:\n```java\nfinal CTDistribuicaoInt distDFeInt = new CTDistribuicaoInt();\ndistDFeInt.setVersao(\"1.00\");\n distDFeInt.setAmbiente(isTeste() ? DFAmbiente.HOMOLOGACAO : DFAmbiente.PRODUCAO);\ndistDFeInt.setUnidadeFederativaAutor(DFUnidadeFederativa.valueOf(\"SC\"));\ndistDFeInt.setCnpj(\"60436332000145\");\ndistDFeInt.setDistribuicao(new CTDistribuicaoNSU().setUltimoNSU(\"000000000036552\");\n\nfinal String retornoConsulta = WSDistribuicaoCTe.consultar(distDFeInt, new NFeConfig());\n```\n\n### Convertendo objetos Java em XML\nQualquer objeto que seja uma representação XML do documento NFe, pode ser obtido seu XML de forma fácil bastando chamar o método **toString**, por exemplo, para conseguir o XML do lote, invoque o toString\n\n```java\nNFLoteEnvio lote = new NFLoteEnvio();\n// setando os dados do lote\n...\n\n// Obtendo o xml do objeto\nString xmlGerado = lote.toString();\n```\n\n### Convertendo nota XML em Java\nExiste uma classe que pode receber um File/String e converter para um objeto NFNota, faça da seguinte forma:\n```java\nfinal NFNota nota = new DFPersister().read(NFNota.class, xmlNota);\nfinal NFNotaProcessada notaProcessada = new DFPersister().read(NFNotaProcessada.class, xmlNotaProcessada);\n```\n\nOu desabilitando o modo estrito (habilitado por padrão):\n```java\nfinal NFNota nota = new DFPersister(false).read(NFNota.class, xmlNota);\n```\n\n### Armazenando notas autorizadas\nVocê precisará armazenar as notas autorizadas por questões legais e também para a geração do DANFE, uma forma de fazer é armazenar o xml das notas ao enviar o lote:\n```java\nfinal List\u003cNFNota\u003e notas = lote.getNotas();\n// Armazena os xmls das notas\n...\n```\nAo fazer a consulta do lote, crie um objeto do tipo **NFNotaProcessada** e adicione o protocolo da nota correspondente, além da nota assinada:\n```java\n// Carregue o xml da nota do local que foi armazenado\nfinal String xmlNotaRecuperada;\n// Assine a nota\nfinal String xmlNotaRecuperadaAssinada = new AssinaturaDigital(config).assinarDocumento(xmlNotaRecuperada);\n// Converta para objeto java\nfinal NFNota notaRecuperadaAssinada = new DFPersister().read(NFNota.class, xmlNotaRecuperadaAssinada);\n// Crie o objeto NFNotaProcessada\nfinal NFNotaProcessada notaProcessada = new NFNotaProcessada();\nnotaProcessada.setVersao(new BigDecimal(NFeConfig.VERSAO_NFE));\nnotaProcessada.setProtocolo(protocolo);\nnotaProcessada.setNota(notaRecuperadaAssinada);\n// Obtenha o xml da nota com protocolo\nString xmlNotaProcessadaPeloSefaz = notaProcessada.toString();\n```\n\n### Funcionalidades\n* Possui validação de campos a nível de código;\n* Valida o XML de envio de lote através dos xsd's disponibilizados pela Sefaz;\n* Gera o XML dos objetos de maneira simples, invocando o metodo toString() dá conta do recado.\n* Suporta diferentes TimeZones, com a implementacao do devido metodo na classe de configuração (DFConfig e suas subclasses).\n\n## Serviços disponíveis\n| Serviço                       | Status              |\n| ----------------------------- | :-----------------: |\n| Envio lote                    | Estável             |\n| Consulta lote                 | Estável             |\n| Consulta status               | Estável             |\n| Consulta nota                 | Estável             |\n| Download nota                 | Estável             |\n| Corrige nota                  | Estável             |\n| Cancela nota                  | Estável             |\n| Inutiliza nota                | Estável             |\n| Consulta cadastro             | Estável             |\n| Manifestação de destinatário  | Estável             |\n\n## Requisitos\n\nJDK \u003e= 1.8\u003cbr\u003e\nMaven \u003e= 3.x\n\n## Criação do Java KeyStore (JKS)\nPara usar os serviços da nota fiscal são necessários dois certificados:\n1) O certificado do cliente que será utilizado para assinar as notas e comunicar com o fisco (fornecido por uma entidade certificadora);\n2) A cadeia de certificados da SEFAZ que queremos acesso;\n\nOs certificados são um ponto crítico já que estes tem validade de apenas um ano (certificado cliente).\nAlém disso as SEFAZ vem trocando suas cadeias de certificado a cada atualização. Dessa forma se surgirem erros de SSL vale a pena verificar se existem novas atualizações de certificados.\nPara gerar a cadeia de certificados, disponibilizamos um pequeno helper que baixa os certificados das SEFAZ e gera o arquivo automaticamente:\n```java\npublic static void main(String args[]){\n    try {\n        FileUtils.writeByteArrayToFile(new File(\"/tmp/producao.cacerts\"), DFCadeiaCertificados.geraCadeiaCertificados(DFAmbiente.PRODUCAO, \"senha\"));\n        FileUtils.writeByteArrayToFile(new File(\"/tmp/homologacao.cacerts\"), DFCadeiaCertificados.geraCadeiaCertificados(DFAmbiente.HOMOLOGACAO, \"senha\"));\n    } catch (Exception e) {\n        e.printStackTrace();\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmixvideo%2Fnfe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwmixvideo%2Fnfe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmixvideo%2Fnfe/lists"}