Passou a acontecer isto num cliente com certificado A3.
O esquisito é que é só neste cliente.
O bloco <X509DATA> está duplicado.
Apagando um dos blocos, ok.
Alguém já teve esse problema?
A solução vai ser colocar na rotina de assinatura para que se o bloco estiver duplicado, retirar um dos blocos.
Mas isto pode atrapalhar o uso da rotina pra NFSE.
Problema com assinatura A3
Moderador: Moderadores
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
Problema com assinatura A3
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
- JoséQuintas
- Administrador

- Mensagens: 20415
- Registrado em: 26 Fev 2007 11:59
- Localização: São Paulo-SP
- Curtiram: 1 vez
Problema com assinatura A3
Lembrei da parte do fonte que parecia que não servia pra nada, até comentei aqui:
https://pctoledo.org/forum/viewto ... ra#p119468
Tinha deixado como anotação no fonte.
Mas vendo o problema que aconteceu, alterei pra isto agora, ainda deixando o anterior anotado:
Em XHarbour não tem hb_At(), mas na sefazclass está resolvido em ze_XHarbour.prg, que pra XHarbour adiciona a função FUNCTION hb_At( cText, nStart, nEnd ); RETURN At( cText, nStart, nEnd )
https://pctoledo.org/forum/viewto ... ra#p119468
Tinha deixado como anotação no fonte.
Mas vendo o problema que aconteceu, alterei pra isto agora, ainda deixando o anterior anotado:
Código: Selecionar todos
STATIC FUNCTION AssinaAjustaAssinado( cXml )
LOCAL nPosIni, nPosFim
cXml := StrTran( cXml, Chr(10), "" )
cXml := StrTran( cXml, Chr(13), "" )
nPosIni := RAt( [<SignatureValue>], cXml ) + Len( [<SignatureValue>] )
cXml := Substr( cXml, 1, nPosIni - 1 ) + StrTran( Substr( cXml, nPosIni ), " ", "" )
// Ocorrência estranha: <X509Data> duplicado num cliente com A3
nPosIni := At( "</X509Data><X509Data>", cXml )
IF nPosIni != 0
nPosFim := hb_At( "</X509Data>", cXml, nPosIni + 5 )
cXml := Substr( cXml, 1, nPosIni - 1 ) + Substr( cXml, nPosFim )
ENDIF
//nPosIni := hb_At( [<X509Certificate>], cXml, nPosIni ) - 1
//nP := nPosIni + 1
//nPosFim := 0
//DO WHILE nP <> 0
// nPosFim := nP
// nP := hb_At( [<X509Certificate>], cXml, nP + 1 )
//ENDDO
//cXml := Substr( cXml, 1, nPosIni ) + Substr( cXml, nPosFim, Len( cXml ) )
RETURN cXml
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"
https://github.com/JoseQuintas/