-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from wmixvideo/assinatura
Nova versão com suporte a qualquer tipo de cetificado.
- Loading branch information
Showing
86 changed files
with
1,249 additions
and
1,636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,105 @@ | ||
package com.fincatto.nfe310; | ||
|
||
import java.io.IOException; | ||
|
||
import com.fincatto.nfe310.classes.NFAmbiente; | ||
import com.fincatto.nfe310.classes.NFTipoEmissao; | ||
import com.fincatto.nfe310.classes.NFUnidadeFederativa; | ||
|
||
public interface NFeConfig { | ||
import java.security.KeyStore; | ||
import java.security.KeyStoreException; | ||
|
||
/** | ||
* Configuração basica do sistema de notas fiscais. | ||
*/ | ||
public abstract class NFeConfig { | ||
|
||
String VERSAO_NFE = "3.10"; | ||
String NFE_NAMESPACE = "http://www.portalfiscal.inf.br/nfe"; | ||
public static final String VERSAO_NFE = "3.10"; | ||
public static final String NFE_NAMESPACE = "http://www.portalfiscal.inf.br/nfe"; | ||
|
||
NFAmbiente getAmbiente(); | ||
/** | ||
* Indica o ambiente de trabalho, se em produção ou homologação. | ||
* | ||
* @return Ambiente de trabalho. | ||
*/ | ||
public NFAmbiente getAmbiente() { | ||
return NFAmbiente.HOMOLOGACAO; | ||
} | ||
|
||
byte[] getCertificado() throws IOException; | ||
/** | ||
* Unidade da federação do emissor das notas. | ||
* | ||
* @return Unidade da federação do emissor. | ||
*/ | ||
public abstract NFUnidadeFederativa getCUF(); | ||
|
||
byte[] getCadeiaCertificados() throws IOException; | ||
/** | ||
* KeyStore contendo o certificado pessoal do emissor. <br> | ||
* Esse certificado é fornecido por uma autoridade certificadora. <br> | ||
* Em caso de dúvidas, consulte seu contador. | ||
* | ||
* @return KeyStore do certificado pessoal. | ||
* @throws KeyStoreException Caso não consiga carregar o KeyStore. | ||
*/ | ||
public abstract KeyStore getCertificadoKeyStore() throws KeyStoreException; | ||
|
||
String getCertificadoSenha(); | ||
/** | ||
* Senha do certificado pessoal do emissor, contido dentro do KeyStore do certificado. | ||
* | ||
* @return Senha do certificado. | ||
* @see #getCertificadoKeyStore() | ||
*/ | ||
public abstract String getCertificadoSenha(); | ||
|
||
String getCadeiaCertificadosSenha(); | ||
/** | ||
* KeyStore contendo a cadeia de certificados da SEFAZ de destino. <br> | ||
* Para gerar a cadeia, use o utilitário fornecido com a biblioteca:<br> | ||
* FileUtils.writeByteArrayToFile(new File("/tmp/producao.cacerts"), NFGeraCadeiaCertificados.geraCadeiaCertificados(NFAmbiente.PRODUCAO, "senha")); | ||
* | ||
* @return KeyStore da cadeia de certificados. | ||
* @throws KeyStoreException Caso nao consiga carregar o KeyStore. | ||
*/ | ||
public abstract KeyStore getCadeiaCertificadosKeyStore() throws KeyStoreException; | ||
|
||
NFUnidadeFederativa getCUF(); | ||
/** | ||
* Senha da cadeia de certificados, contida dentro do KeyStore da cadeia. | ||
* | ||
* @return Senha da cadeia de certificados. | ||
* @see #getCadeiaCertificadosKeyStore() | ||
*/ | ||
public abstract String getCadeiaCertificadosSenha(); | ||
|
||
NFTipoEmissao getTipoEmissao(); | ||
/** | ||
* ID de contribuinte, somente para NFCe. | ||
* | ||
* @return ID do contribuinte. | ||
*/ | ||
public Integer getCodigoSegurancaContribuinteID() { | ||
return null; | ||
} | ||
|
||
String getSSLProtocolo(); | ||
/** | ||
* Codigo de seguranca do contribuinte, com 36 caracteres, somente para NFCe. | ||
* | ||
* @return Codigo de segurança do contribuinte. | ||
*/ | ||
public String getCodigoSegurancaContribuinte() { | ||
return null; | ||
} | ||
|
||
Integer getCodigoSegurancaContribuinteID(); | ||
/** | ||
* Tipo da emissão das notas (se normal ou em contingência). | ||
* | ||
* @return Tipo da emissão das notas. | ||
*/ | ||
public NFTipoEmissao getTipoEmissao() { | ||
return NFTipoEmissao.EMISSAO_NORMAL; | ||
} | ||
|
||
String getCodigoSegurancaContribuinte(); | ||
/** | ||
* Protocolo de SSL, usado pela SEFAZ para receber as notas. | ||
* | ||
* @return Protocolo SSL da SEFAZ de origem. | ||
*/ | ||
public String getSSLProtocolo() { | ||
return "TLSv1"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
src/main/java/com/fincatto/nfe310/classes/NFFormaPagamentoPrazo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.