Ir para conteúdo
  • Cadastre-se

vasilvei

Membros
  • Total de ítens

    64
  • Registro em

  • Última visita

Tudo que vasilvei postou

  1. vasilvei

    Erro no Windows 10

    Bom dia pessoal Estou com problema ao ativar a ECF Espon, tando usando o ACBR Monitor quando ao ativar usando o Java, quando eu tinha o windows 7 funcionava perfeitamente, porém agora com o Windows 10, esta dando o seguinte Erro: Error 87 Paramentro incorreto, conforme imagem em anexo, porém se eu abrir o Interven da Epson, consigo executar as funções da impressora ECF normalmente, o windows 10 64Bits, a Dll é 32Bits e estou usando o Java 32Bits.
  2. vasilvei

    Erro Ao Assinar Aquivo

    Boa noite galera, seguinte estou um erro que acontece as vezes quando eu vou assinar o arquivo com a EAD, eu implentei em java para fazer a assinara, e uso libeay32.dll. Abaixo esta o codigo que faço no AcbrEAD.java. public String assinarArquivoComEAD(String nomeArquivo, boolean remove) throws ACBrException { ByteBuffer returnBuffer = ByteBuffer.allocate(STR_BUFFER_LEN); int ret = ACBrEADInterop.INSTANCE.EAD_AssinarArquivoComEAD(getHandle(), toUTF8(nomeArquivo), remove, returnBuffer, STR_BUFFER_LEN); checkResult(ret); return fromUTF8(returnBuffer, ret); } Aqui eu chamo o meu metodo, passando o caminho do arquivo. ACBrEAD.assinarArquivoComEAD(pathArquivo, true); e quando ele tenta assinar, ele fecha aplicação e gera um txt aonde esta o .jar # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x76fce41b, pid=1528, tid=5196 # # JRE version: 7.0_21-b11 # Java VM: Java HotSpot(TM) Client VM (23.21-b01 mixed mode, sharing windows-x86 ) # Problematic frame: # C [ntdll.dll+0x2e41b] RtlInitUnicodeString+0x1f3 # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # ........ alguém sabe me dizer o porque ocorre isso, é só as vezes.
  3. Boa noite gostaria de saber como eu faço para contribuir para o projeto em java, tenho a parte em java do AcbrBAL, e AcbrEAD, com eu faço para submeter esse código? -Para eu implementar funcionalidades para as ecfs, eu implemento no projeto ACBRFramework, exemplo eu uso uma epson para a minha Automação, e o cancelamento parcial não esta implementado, gostaria de saber como eu faço para implementar, em lazarus. -A nova versão do paf pede também o binário do Arq. MF e Arq. MFD, com que eu faço para implementar esses métodos, pois não encontrei, o Rafael falou nesse post: já esta implementado, mas não sei como chama-los. Resumindo para eu ajudar a desenvolver o ACBRFramework, eu devo usar o código que esta em Lazarus nesse repositório: https://acbr.svn.sourceforge.net/svnroot/acbr? e para desenvolver para a ecf epson como sitei acima também é no ACBRFramework? Obrigado! Att. Valde
  4. Por acaso seriam esses métodos? que estão no ACBrECF.java eu tentei chamar esses metodos e eles geram os arquivos .txt, por favor se aguém puder me ajudar, ficarei muito grato, pois tenho homologação em uns 10 dias e só falta isso para concluir. public void arquivoMFD_DLL(Date DataInicial, Date DataFinal, String CaminhoArquivo, int Finaliza, int Documentos[]) throws ACBrException { int ret = ACBrECFInterop.INSTANCE.ECF_ArquivoMFD_DLL(getHandle(), OleDate.toOADate(DataInicial), OleDate.toOADate(DataFinal), toUTF8(CaminhoArquivo), Documentos, Documentos.length, Finaliza); checkResult(ret); } public void arquivoMFD_DLL(int COOInicial, int COOFinal, String CaminhoArquivo, int Finaliza, int TipoContador, int Documentos[]) throws ACBrException { int ret = ACBrECFInterop.INSTANCE.ECF_ArquivoMFD_DLL_COO(getHandle(), COOInicial, COOFinal, toUTF8(CaminhoArquivo), Documentos, Documentos.length, Finaliza, TipoContador); checkResult(ret); }
  5. Obrigado Rafael por responder... -Qual o nome do metodo no ACBrECFIntepor,java, e o nome no ACBrECF.java e quais são os paramentros? -
  6. Alguém por favor, eu vi o pessoa fez no acbr, eu gostaria de saber se tem fazer no Acbrframework, se alguém puder me ajudar me passando algum tutorial de como faz para compilar o Acbrframework em lazarus já ajudaria??? Estou precisando muito disso.... Obrigado!
  7. Olá eu uso o java, e estou usando a dll ACBRFramework, já esta disponível nessa dll os metodos ArquivoMFD_DLL e ArquivoMF_DLL? Obrigado!
  8. vasilvei

    Arq. Binário Mf, Mfd

    Boa tarde, a nova ER do paf pede para gerar o Arq. MFD e MF, binário como devo fazer isso?
  9. vasilvei

    Acbrpaf Java

    eu fiz isso: public void saveFileTXT_P(RegistroP1 registroP1, RegistroP2[] registroP2, String arquivo, int countP2) throws ACBrException { ACBrPAFInterop.RegistroHD1Rec recordP1 = new ACBrPAFInterop.RegistroHD1Rec(); recordP1.CNPJ = registroP1.getCNPJ().toCharArray(); recordP1.IE = registroP1.getIE().toCharArray(); recordP1.IM = registroP1.getIM().toCharArray(); recordP1.RAZAOSOCIAL = registroP1.getRAZAOSOCIAL().toCharArray(); recordP1.UF = registroP1.getUF().toCharArray(); ACBrPAFInterop.RegistroP2Rec[] array = new ACBrPAFInterop.RegistroP2Rec[countP2]; for (int i = 0; i < countP2; i++) { ACBrPAFInterop.RegistroP2Rec record = new ACBrPAFInterop.RegistroP2Rec(); record.COD_MERC_SERV = registroP2[i].getCOD_MERC_SERV().toCharArray(); record.ALIQ = registroP2[i].getALIQ(); record.DESC_MERC_SERV = registroP2[i].getDESC_MERC_SERV().toCharArray(); record.IAT = registroP2[i].getIAT().toCharArray(); record.ST = registroP2[i].getST().toCharArray(); record.IPPT = registroP2[i].getIPPT().toCharArray(); record.UN_MED = registroP2[i].getUN_MED().toCharArray(); record.VL_UNIT = registroP2[i].getVL_UNIT(); record.RegistroValido = registroP2[i].isRegistroValido(); array[i] = record; } // this.aliquotas = array; int ret = ACBrPAFInterop.INSTANCE.PAF_SaveFileTXT_P(getHandle(), recordP1, array, countP2, toUTF8(arquivo));//ECF_PafMF_MFD_Espelho_COO(getHandle(), COOInicial, COOFinal, toUTF8(CaminhoArquivo)); checkResult(ret); } e deu esse erro: # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x19735f57, pid=2572, tid=4548 # # JRE version: 7.0_17-b02 # Java VM: Java HotSpot(TM) Client VM (23.7-b01 mixed mode windows-x86 ) # Problematic frame: # C [ACBrFramework32.dll+0x5f57] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # An error report file with more information is saved as: # E:\Projeto Arena\Projeto_Win\Arena\hs_err_pid2572.log # # If you would like to submit a bug report, please visit: # http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. #
  10. vasilvei

    Acbrpaf Java

    É +/- isso:? private void saveFileTXT_P(RegistroHD1Rec registroHD1Rec, RegistroP2Rec[] registroP2Rec, String arquivo) throws ACBrException { int ret = ACBrPAFInterop.INSTANCE.PAF_SaveFileTXT_P(getHandle(), registroHD1Rec, registroP2Rec, registroP2Rec.length, toUTF8(arquivo)); checkResult(ret); }
  11. vasilvei

    Acbrpaf Java

    Bom dia eu terminei de fazer o AcbrEAD.java estou tentando desenvolver o AcbrPaf.java, gostaria de uma ajudinha por exemplo estou tentando fazer o metodo: int PAF_SaveFileTXT_P(int pafHandle, ACBrPAFInterop.RegistroHD1Rec RegistroP1, ACBrPAFInterop.RegistroP2Rec RegistroP2[], int CountP2, String Arquivo); no caso eu peguei o exemplo do AcbrEcf.java das Aliquotas, mas é um pouco diferente, se você puderem me passar o procedimento desse metodo eu faço os outros e mando para vocês, eu pretendo ajudar manter a implementação do Acbr para o java. o que eu fiz até então criei a classe ACBrPAF.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jACBrFramework.serial.ecf; import com.sun.jna.ptr.IntByReference; import jACBrFramework.ACBrClass; import jACBrFramework.ACBrException; import jACBrFramework.interop.ACBrPAFInterop; import jACBrFramework.interop.ACBrPAFInterop.RegistroHD1Rec; import jACBrFramework.interop.ACBrPAFInterop.RegistroP2Rec; import java.nio.ByteBuffer; /** * * @author Valde */ public final class ACBrPAF extends ACBrClass { private RegistroHD1Rec registroHD1Rec; private RegistroP2Rec[] registroP2Rec; public ACBrPAF() throws ACBrException { } @Override protected void onInitialize() throws ACBrException { IntByReference handle = new IntByReference(); int ret = ACBrPAFInterop.INSTANCE.PAF_Create(handle); checkResult(ret); setHandle(handle.getValue()); } @Override protected void onFinalize() throws ACBrException { int ret = ACBrPAFInterop.INSTANCE.PAF_Destroy(getHandle()); checkResult(ret); setHandle(0); } @Override protected void checkResult(int result) throws ACBrException { switch (result) { case -1: String message; int LEN = 1024; ByteBuffer buffer = ByteBuffer.allocate(LEN); int ret = ACBrPAFInterop.INSTANCE.PAF_GetUltimoErro(getHandle(), buffer, LEN); message = fromUTF8(buffer, ret); throw new ACBrException(message); case -2: throw new ACBrException("ACBr PAF não inicializado."); } } private void saveFileTXT_P(){ } } também criei o objeto RegistroP1.java, RegistroP2.java /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package br.com.arena.paf.model; /** * * @author Valde */ public class RegistroP1 { public String RAZAOSOCIAL; public String UF; public String CNPJ; public String IE; public String IM; public RegistroP1() { } public RegistroP1(String RAZAOSOCIAL, String UF, String CNPJ, String IE, String IM) { this.RAZAOSOCIAL = RAZAOSOCIAL; this.UF = UF; this.CNPJ = CNPJ; this.IE = IE; this.IM = IM; } public String getRAZAOSOCIAL() { return RAZAOSOCIAL; } public void setRAZAOSOCIAL(String RAZAOSOCIAL) { this.RAZAOSOCIAL = RAZAOSOCIAL; } public String getUF() { return UF; } public void setUF(String UF) { this.UF = UF; } public String getCNPJ() { return CNPJ; } public void setCNPJ(String CNPJ) { this.CNPJ = CNPJ; } public String getIE() { return IE; } public void setIE(String IE) { this.IE = IE; } public String getIM() { return IM; } public void setIM(String IM) { this.IM = IM; } } /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package br.com.arena.paf.model; /** * * @author Valde */ public class RegistroP2 { public String COD_MERC_SERV; public String DESC_MERC_SERV; public String UN_MED; public String IAT; public String IPPT; public String ST; public double ALIQ; public double VL_UNIT; public boolean RegistroValido; public RegistroP2() { } public String getCOD_MERC_SERV() { return COD_MERC_SERV; } public void setCOD_MERC_SERV(String COD_MERC_SERV) { this.COD_MERC_SERV = COD_MERC_SERV; } public String getDESC_MERC_SERV() { return DESC_MERC_SERV; } public void setDESC_MERC_SERV(String DESC_MERC_SERV) { this.DESC_MERC_SERV = DESC_MERC_SERV; } public String getUN_MED() { return UN_MED; } public void setUN_MED(String UN_MED) { this.UN_MED = UN_MED; } public String getIAT() { return IAT; } public void setIAT(String IAT) { this.IAT = IAT; } public String getIPPT() { return IPPT; } public void setIPPT(String IPPT) { this.IPPT = IPPT; } public String getST() { return ST; } public void setST(String ST) { this.ST = ST; } public double getALIQ() { return ALIQ; } public void setALIQ(double ALIQ) { this.ALIQ = ALIQ; } public double getVL_UNIT() { return VL_UNIT; } public void setVL_UNIT(double VL_UNIT) { this.VL_UNIT = VL_UNIT; } public boolean isRegistroValido() { return RegistroValido; } public void setRegistroValido(boolean RegistroValido) { this.RegistroValido = RegistroValido; } } Por gentileza se puderem me ajudar a implementação do private void saveFileTXT_P() da classe AcbrECF.java eu me viro com o resto. Obrigado!
  12. Deu certo galera, muito obrigado pela ajuda, eu estava chamando um metodo que alterava o arquivo depois de assinado.
  13. Eu fiz um exemplo,fiz a assinatura de um arquivo com as mesmas chaves que estou usando no java, fiz a assinatura pelo Lazaruz, pelo exemplo do acbr, daí validou, sabem o que pode estar ocorrendo com a minha aplicação em java? Obrigado!
  14. Ainda não esta validando, primeiro fiz o que você falou colocando o begin e o end, não validou. daí tentei gerar novamente o par de chaves e o xml da SH pelo exemplo do Lazaruz, e coloquei no meu aplicativo continua dando erro. public static void ativarEad() { try { ACBrEAD = new ACBrEAD(); ACBrEAD.addOnGetChavePrivada(new ACBrEventListener<ChaveEventObject>() { @Override public void notification(ChaveEventObject e) { e.setChave("-----BEGIN RSA PRIVATE KEY-----" + "\n" + "MIICXAIBAAKBgQDp/V8QcF+Tt1FPN9ZHMYCsVJWE4trenBRClGOTRnESNuFHvWs+" + "\n" + "MT6opx1EQTwI0YAGzQJZwNl64GtFNmuNJvnborn8Ll84mSyUEG4NSx6+10nAb0P7" + "\n" + "LMiK9OXdG/ivTc8Ssn06Sgvg+p1nD6tvY038XbfJbLAFOQ85DxVWn7RrQQIDAQAB" + "\n" + "AoGBAKcI+JQDpDcO5jxm39Byxig/OX1jdFr1kID27R51asJV6vwLfEMpZFGA+qN+" + "\n" + "7hxdccdpEgSAZsAQ9IK0FpLs/+8s/W4NqBOGQj9w3Y6aSeXrXYlgsyek3jAOKT/v" + "\n" + "IdwKn1OppxPKT6ppl0+qFHcl5O5ZTbqk7ADbKfSRLTfR4esBAkEA+S7RlMK9vUmo" + "\n" + "cVadnhr8TgOjdicerQ3XOJoWJNyGmX+2ziqJB+lTm6wYu7lpTzT3izBNoCKS1VzC" + "\n" + "UXHHRBvwlwJBAPBkJUlLDP28t4LqnOWdJg2h7bR90o/OjJ69hEr5bXOMIQIehpz+" + "\n" + "ivTSLLNajaOHOQM6rfOQZFeOTn5qxwubpecCQHfVQSr2QEMwkhX3XpNzTNTDwS+H" + "\n" + "/qOgnVj2GSIe/4gAOEyLfhzU48VgjQByWSejREymrR4OomiDVFvQiNDDUv8CQGk0" + "\n" + "ywS6reLWltHa7/OlxSOuPKQDdQWu9ef7NUzCwN4S89dDmNJYrGPdH+cWuGpbId6B" + "\n" + "7eNszB1tkHjPLnGsGv0CQF5W43durX4WS+0SUHPIeNpNtA9c6gwuRKbLqlyvVLoL" + "\n" + "fNLeG+ye46qc9ikpHtvfn69tYU4hHDylKrXES4ZVTDk=" + "\n" + "-----END RSA PRIVATE KEY-----"); } }); ACBrEAD.addOnGetChavePublica(new ACBrEventListener<ChaveEventObject>() { @Override public void notification(ChaveEventObject e) { e.setChave("-----BEGIN PUBLIC KEY-----" + "\n" + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDp/V8QcF+Tt1FPN9ZHMYCsVJWE" + "\n" + "4trenBRClGOTRnESNuFHvWs+MT6opx1EQTwI0YAGzQJZwNl64GtFNmuNJvnborn8" + "\n" + "Ll84mSyUEG4NSx6+10nAb0P7LMiK9OXdG/ivTc8Ssn06Sgvg+p1nD6tvY038XbfJ" + "\n" + "bLAFOQ85DxVWn7RrQQIDAQAB" + "\n" + "-----END PUBLIC KEY-----"); } }); } catch (ACBrException ex) { TrataException.trataInformacao(ex.getMessage()); } } esta certa a minha classe ACBrEAD.java: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package jACBrFramework.serial.ecf; import com.sun.jna.ptr.IntByReference; import jACBrFramework.ACBrClass; import jACBrFramework.ACBrEventListener; import jACBrFramework.ACBrException; import jACBrFramework.ChaveEventObject; import jACBrFramework.interop.ACBrEADInterop; import java.nio.ByteBuffer; /** * * @author Valde */ public class ACBrEAD extends ACBrClass { public ACBrEAD() throws ACBrException { } @Override protected void onInitialize() throws ACBrException { IntByReference handle = new IntByReference(); int ret = ACBrEADInterop.INSTANCE.EAD_Create(handle); checkResult(ret); setHandle(handle.getValue()); } @Override protected void onFinalize() throws ACBrException { int ret = ACBrEADInterop.INSTANCE.EAD_Destroy(getHandle()); checkResult(ret); setHandle(0); } @Override protected void checkResult(int result) throws ACBrException { switch (result) { case -1: String message; int LEN = 1024; ByteBuffer buffer = ByteBuffer.allocate(LEN); int ret = ACBrEADInterop.INSTANCE.EAD_GetUltimoErro(getHandle(), buffer, LEN); message = fromUTF8(buffer, ret); throw new ACBrException(message); case -2: throw new ACBrException("ACBr EAD não inicializado."); } } public void addOnGetChavePrivada(ACBrEventListener<ChaveEventObject> listener) { if (!hasListeners("OnGetChavePrivada")) { ACBrEADInterop.INSTANCE.EAD_SetOnGetChavePrivada(getHandle(), new ACBrEADInterop.GetChavePrivadaCallback() { @Override public String invoke() { return OnGetChavePrivada(); } }); } addListener("OnGetChavePrivada", listener); } public void removeOnPAFGetKeyRSA(ACBrEventListener<ChaveEventObject> listener) { removeListener("OnGetChavePrivada", listener); if (!hasListeners("OnGetChavePrivada")) { ACBrEADInterop.INSTANCE.EAD_SetOnGetChavePrivada(getHandle(), null); } } private String OnGetChavePrivada() { ChaveEventObject e = new ChaveEventObject(this, ""); notifyListeners("OnGetChavePrivada", e); return e.getChave(); } public void addOnGetChavePublica(ACBrEventListener<ChaveEventObject> listener) { if (!hasListeners("OnGetChavePublica")) { ACBrEADInterop.INSTANCE.EAD_SetOnGetChavePublica(getHandle(), new ACBrEADInterop.GetChavePublicaCallback() { @Override public String invoke() { return OnGetChavePublica(); } }); } addListener("OnGetChavePublica", listener); } public void removeOnGetChavePublica(ACBrEventListener<ChaveEventObject> listener) { removeListener("OnGetChavePublica", listener); if (!hasListeners("OnGetChavePublica")) { ACBrEADInterop.INSTANCE.EAD_SetOnGetChavePublica(getHandle(), null); } } private String OnGetChavePublica() { ChaveEventObject e = new ChaveEventObject(this, ""); notifyListeners("OnGetChavePublica", e); return e.getChave(); } // Funções /** * @return String * @param arquivo local para gravar o arquivo * @param remove boolean * @throws ACBrException */ public String assinarArquivoComEAD(String nomeArquivo, boolean remove) throws ACBrException { ByteBuffer returnBuffer = ByteBuffer.allocate(STR_BUFFER_LEN); int ret = ACBrEADInterop.INSTANCE.EAD_AssinarArquivoComEAD(getHandle(), toUTF8(nomeArquivo), remove, returnBuffer, STR_BUFFER_LEN); checkResult(ret); return fromUTF8(returnBuffer, ret); } public String calcularChavePublica() throws ACBrException { ByteBuffer returnBuffer = ByteBuffer.allocate(STR_BUFFER_LEN); int ret = ACBrEADInterop.INSTANCE.EAD_CalcularChavePublica(getHandle(), returnBuffer, STR_BUFFER_LEN); checkResult(ret); return fromUTF8(returnBuffer, ret); } public void calcularEADArquivo(String nomeArquivo) throws ACBrException { ByteBuffer returnBuffer = ByteBuffer.allocate(STR_BUFFER_LEN); int ret = ACBrEADInterop.INSTANCE.EAD_CalcularEADArquivo(getHandle(), toUTF8(nomeArquivo), returnBuffer, STR_BUFFER_LEN); checkResult(ret); } public void gerarChaves() throws ACBrException { ByteBuffer returnBuffer = ByteBuffer.allocate(STR_BUFFER_LEN); int ret = ACBrEADInterop.INSTANCE.EAD_GerarChaves(getHandle(), returnBuffer, returnBuffer, STR_BUFFER_LEN); checkResult(ret); } public void gerarXMLeECFc(String nomeSH, String pathArquivo) throws ACBrException { int ret = ACBrEADInterop.INSTANCE.EAD_GerarXMLeECFc(getHandle(), toUTF8(nomeSH), toUTF8(pathArquivo)); checkResult(ret); } public void removeEADArquivo(String nomeArquivo) throws ACBrException { int ret = ACBrEADInterop.INSTANCE.EAD_RemoveEADArquivo(getHandle(), toUTF8(nomeArquivo)); checkResult(ret); } public boolean verificaEAD(String ead) throws ACBrException { int ret = ACBrEADInterop.INSTANCE.EAD_VerificarEAD(getHandle(), toUTF8(ead)); checkResult(ret); return ret != 0; } public boolean verificaEADArquivo(String nomeArquivo) throws ACBrException { int ret = ACBrEADInterop.INSTANCE.EAD_VerificarEADArquivo(getHandle(), toUTF8(nomeArquivo)); checkResult(ret); return ret != 0; } }
  15. Obrigado Rafael, eu fiz o seguinte peguei as chaves e coloquei um metodo que quando eu inicializo o aplicativo ele chama esse metodo: public static void ativarEad() { try { ACBrEAD = new ACBrEAD(); ACBrEAD.addOnGetChavePrivada(new ACBrEventListener<ChaveEventObject>() { @Override public void notification(ChaveEventObject e) { e.setChave("MIICXAIBAAKBgQCv6M1/kW13FVMNG/d7Mwe2SB9r6A11FbDuJ0tt0S3o/u+NJ7DF"+"\n" + "8dGIaJnYCxYP7lVKPWEH8k1K1sLYF5+nT8Mvv8HT2FRuL60moI7IUldpR/BfPcm5"+"\n" + "kW1/ru4LrNERlTQ2d8F0Fw0YF80A1whD2a4U3mKHmmXTI2ezUmeZWcXF6QIDAQAB"+"\n" + "AoGAPsa573iatBCsHtWIMDM54VdDv2KEyu/+wD7NsFciJzAzlRBBCaMOv7t0i6EJ"+"\n" + "Mo4/acsVwZw68SZLSorDsxXH9b4yDy+EcDULUY8w4W1pjn7/uWBYqEUHN1CBFGsi"+"\n" + "Q7bZ8HD9qps69ll9z3BJHtJ4QHoA8cN2OeZ5PuKPyj7jWAECQQDpsJd9XQwDCt0l"+"\n" + "HSXTKUjj4dBLgX4ot4jkvQiWOsuhnrIYX1QKl0CM030T4ai4xuIOPBq+4TX5Ehdz"+"\n" + "akhirzWpAkEAwLQM1VglsZCR9ajh3qN3YcF+9v0Mt763hreiln3xQ0BSpYtqxtP1"+"\n" + "Wq4cJgHLS2IFj3eDnsp6FmDvD6WnUeu2QQJAQvukIIHoLIMTqky1h9ZAl1klnE7s"+"\n" + "u30IFxB8AputvJDBWa0RaMu76+G+61D2TKhtKUlfHTFuiAsAf8uKHgc8qQJAfTB7"+"\n" + "Zd5uHn0dVcrxcgIgfJGIOk0LBhQQhqSmK76GDnqrNoDsTV9F9jNGdiqUN9TmZ93s"+"\n" + "1CwWRJOUu0WS/dV0AQJBAK1HVx/CybyhTULjfsItL39cHhPbaOzNImJjURtJQST3"+"\n" + "gyzTJyL4k0vNugwpmWURBkGv8TCowYjdic8/lEjaJT0="); } }); ACBrEAD.addOnGetChavePublica(new ACBrEventListener<ChaveEventObject>() { @Override public void notification(ChaveEventObject e) { e.setChave("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCv6M1/kW13FVMNG/d7Mwe2SB9r"+"\n" + "6A11FbDuJ0tt0S3o/u+NJ7DF8dGIaJnYCxYP7lVKPWEH8k1K1sLYF5+nT8Mvv8HT"+"\n" + "2FRuL60moI7IUldpR/BfPcm5kW1/ru4LrNERlTQ2d8F0Fw0YF80A1whD2a4U3mKH"+"\n" + "mmXTI2ezUmeZWcXF6QIDAQAB"); } }); } catch (ACBrException ex) { TrataException.trataInformacao(ex.getMessage()); } } dai eu mandei gerar o arquivo ArqMF, por exemplo: ACBrECF.pafMF_LMFC_Cotepe1704(inicio, fim, caminhoArquivo); e mandei assinar o arquivo: Ead.assinarArquivo(caminhoArquivo + "ACBr_CTP.txt"); ..... public static void assinarArquivo(String pathArquivo) { try { ACBrEAD.assinarArquivoComEAD(pathArquivo, true); } catch (ACBrException ex) { TrataException.trataInformacao(ex.getMessage()); } } ele gerar normalmente o arquivo, e também a EAD no final do arquivo. porém quando eu vou validar, no eECFc, seleciono a arquivo xml SH que eu gerei pelo exemplo EAD em lazaruz, e seleciono o arquivo diz que a assinatura inválida. Sabe me dizer se esta faltando algo ou no que eu posso estar errando? Obrigado!
  16. Rafael, eu gerei as assinaturas e arquivo xml com o nome da SH com o exemplo do lazarus. mas com eu faço para vincular essas chaves ao meu aplicativo java? Obrigado! desculpe se estou sendo inconveniente, mas se você puder me ajudar nesses detalhes, ficarei muito grato.
  17. Eu sei o que é listener, desculpe tinha interpretado de outra forma. Obrigado!
  18. Certo, no caso eu gero o par de chaves pelo delphi por exemplo, isso já consegui... daí eu para eu setar as chaves no meu aplicativo java como EMBarbosa citou antes. Eu passo o caminho no OnGetChavePrivada e OnGetChavePublica private String OnGetChavePublica() { ChaveEventObject e = new ChaveEventObject(this, "c://pub_key.pem"); notifyListeners("OnGetChavePublica", e); return e.getChave(); } é isso que devo fazer? Obrigado Rafael!
  19. Como eu faço para eu gerar meu par de chaves, que eu não tenho ainda com o java? e para eu passar as chaves no OnGetChavePrivada e OnGetChavePublica, eu passo o caminho da chave gerada ou a chave em formato string? Obrigado!
  20. Desculpe a minha ignorância, mas no meu caso eu não tenho o par de chaves, daí eu não deveria gerar elas?
  21. vasilvei

    Ead

    Alguém pode me ajudar ...:
  22. Mais uma evolução estava faltando uma Dll, chamad: libeay32.dll, não deu nenhum erro ao gerar, eu só não encontrei as chaves, com eu faço para setar o caminho?
  23. Descubri o porque do null, hahrharh. estava faltando o ACBrEAD = new ACBrEAD(); quando eu faço : public static void gerarChaves(){ try { ACBrEAD = new ACBrEAD(); ACBrEAD.gerarChaves(); } catch (ACBrException ex) { TrataException.trataInformacaoLog(ex.getMessage()); } } ele retorna "Erro ao gerar par de Chaves RSA" qual é o procedimento correto para gerar as chaves?
×
×
  • Criar Novo...

Informação Importante

Colocamos cookies em seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies, caso contrário, assumiremos que você está bem para continuar.