Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Colaboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 21-09-2021
Ramon88 Ramon88 is offline
Miembro
 
Registrado: ago 2021
Posts: 157
Poder: 6
Ramon88 Va por buen camino
Bueno, intentaremos sacarlo...


Alguien tiene la clase para calcular CRC8 en .Net o c#??
Responder Con Cita
  #2  
Antiguo 21-09-2021
ermendalenda ermendalenda is offline
Miembro
 
Registrado: ago 2021
Posts: 2.766
Poder: 8
ermendalenda Va por buen camino
Cita:
Empezado por Ramon88 Ver Mensaje
Bueno, intentaremos sacarlo...


Alguien tiene la clase para calcular CRC8 en .Net o c#??

En Vb cambiando poca cosa te vale para net:
Código:
Private Declare Function WideCharToMultiByte Lib "kernel32" ( _
    ByVal CodePage As Long, _
    ByVal dwFlags As Long, _
    ByVal lpWideCharStr As Long, _
    ByVal cchWideChar As Long, _
    ByVal lpMultiByteStr As Long, _
    ByVal cbMultiByte As Long, _
    ByVal lpDefaultChar As Long, _
    ByVal lpUsedDefaultChar As Long) As Long

Dim CRC8_Table As Variant
' CodePage constant for UTF-8
Private Const CP_UTF8 = 65001

''' Return byte array with VBA "Unicode" string encoded in UTF-8
Function Utf8BytesFromString(strInput As String) As Variant
    Dim nBytes As Long
    ' Catch empty or null input string
    Utf8BytesFromString = vbNullString
    If Len(strInput) < 1 Then Exit Function
    ' Get length in bytes *including* terminating null
    nBytes = WideCharToMultiByte(CP_UTF8, 0&, ByVal StrPtr(strInput), -1, 0&, 0&, 0&, 0&)
    ' We don't want the terminating null in our byte array, so ask for `nBytes-1` bytes
    Dim abBuffer() As Byte
    
    ReDim abBuffer(nBytes - 2)  ' NB ReDim with one less byte than you need
    nBytes = WideCharToMultiByte(CP_UTF8, 0&, ByVal StrPtr(strInput), -1, ByVal VarPtr(abBuffer(0)), nBytes - 1, 0&, 0&)
    Utf8BytesFromString = abBuffer
End Function


Public Function crc8(buffer As String, Polynom, Initial As Variant) As Variant
CRC8_Table = Array(&H0, &H7, &HE, &H9, &H1C, &H1B, &H12, &H15, _
    &H38, &H3F, &H36, &H31, &H24, &H23, &H2A, &H2D, &H70, &H77, &H7E, &H79, &H6C, &H6B, &H62, &H65, _
    &H48, &H4F, &H46, &H41, &H54, &H53, &H5A, &H5D, &HE0, &HE7, &HEE, &HE9, &HFC, &HFB, &HF2, &HF5, _
    &HD8, &HDF, &HD6, &HD1, &HC4, &HC3, &HCA, &HCD, &H90, &H97, &H9E, &H99, &H8C, &H8B, &H82, &H85, _
    &HA8, &HAF, &HA6, &HA1, &HB4, &HB3, &HBA, &HBD, &HC7, &HC0, &HC9, &HCE, &HDB, &HDC, &HD5, &HD2, _
    &HFF, &HF8, &HF1, &HF6, &HE3, &HE4, &HED, &HEA, &HB7, &HB0, &HB9, &HBE, &HAB, &HAC, &HA5, &HA2, _
    &H8F, &H88, &H81, &H86, &H93, &H94, &H9D, &H9A, &H27, &H20, &H29, &H2E, &H3B, &H3C, &H35, &H32, _
    &H1F, &H18, &H11, &H16, &H3, &H4, &HD, &HA, &H57, &H50, &H59, &H5E, &H4B, &H4C, &H45, &H42, _
    &H6F, &H68, &H61, &H66, &H73, &H74, &H7D, &H7A, &H89, &H8E, &H87, &H80, &H95, &H92, &H9B, &H9C, _
    &HB1, &HB6, &HBF, &HB8, &HAD, &HAA, &HA3, &HA4, &HF9, &HFE, &HF7, &HF0, &HE5, &HE2, &HEB, &HEC, _
    &HC1, &HC6, &HCF, &HC8, &HDD, &HDA, &HD3, &HD4, &H69, &H6E, &H67, &H60, &H75, &H72, &H7B, &H7C, _
    &H51, &H56, &H5F, &H58, &H4D, &H4A, &H43, &H44, &H19, &H1E, &H17, &H10, &H5, &H2, &HB, &HC, _
    &H21, &H26, &H2F, &H28, &H3D, &H3A, &H33, &H34, &H4E, &H49, &H40, &H47, &H52, &H55, &H5C, &H5B, _
    &H76, &H71, &H78, &H7F, &H6A, &H6D, &H64, &H63, &H3E, &H39, &H30, &H37, &H22, &H25, &H2C, &H2B, _
    &H6, &H1, &H8, &HF, &H1A, &H1D, &H14, &H13, &HAE, &HA9, &HA0, &HA7, &HB2, &HB5, &HBC, &HBB, _
    &H96, &H91, &H98, &H9F, &H8A, &H8D, &H84, &H83, &HDE, &HD9, &HD0, &HD7, &HC2, &HC5, &HCC, &HCB, _
    &HE6, &HE1, &HE8, &HEF, &HFA, &HFD, &HF4, &HF3)
 
  Dim data As Variant
    data = Utf8BytesFromString(buffer)
  Dim alen, i As Integer
  Dim crc As Byte
  'data = Buffer ':= TEncoding.UTF8.GetBytes(Cadena);
  alen = UBound(data)
  crc = 0
    
  For i = 0 To alen
    crc = CRC8_Table((crc Xor data(i)) And &HFF)
   
Next
    crc8 = crc And &HFF



End Function

Para llamar a la función y que te devuelva en cr8:
cr8 = crc8(Cadena_enviada, 7, 0)


iNITIAL Y POLYNOM CREO QUE PUEDES OBVIARLAS

Última edición por ermendalenda fecha: 21-09-2021 a las 19:47:12.
Responder Con Cita
  #3  
Antiguo 22-09-2021
Ramon88 Ramon88 is offline
Miembro
 
Registrado: ago 2021
Posts: 157
Poder: 6
Ramon88 Va por buen camino
Cita:
Empezado por ermendalenda Ver Mensaje
En Vb cambiando poca cosa te vale para net:
Código:
Private Declare Function WideCharToMultiByte Lib "kernel32" ( _
    ByVal CodePage As Long, _
    ByVal dwFlags As Long, _
    ByVal lpWideCharStr As Long, _
    ByVal cchWideChar As Long, _
    ByVal lpMultiByteStr As Long, _
    ByVal cbMultiByte As Long, _
    ByVal lpDefaultChar As Long, _
    ByVal lpUsedDefaultChar As Long) As Long

Dim CRC8_Table As Variant
' CodePage constant for UTF-8
Private Const CP_UTF8 = 65001

''' Return byte array with VBA "Unicode" string encoded in UTF-8
Function Utf8BytesFromString(strInput As String) As Variant
    Dim nBytes As Long
    ' Catch empty or null input string
    Utf8BytesFromString = vbNullString
    If Len(strInput) < 1 Then Exit Function
    ' Get length in bytes *including* terminating null
    nBytes = WideCharToMultiByte(CP_UTF8, 0&, ByVal StrPtr(strInput), -1, 0&, 0&, 0&, 0&)
    ' We don't want the terminating null in our byte array, so ask for `nBytes-1` bytes
    Dim abBuffer() As Byte
    
    ReDim abBuffer(nBytes - 2)  ' NB ReDim with one less byte than you need
    nBytes = WideCharToMultiByte(CP_UTF8, 0&, ByVal StrPtr(strInput), -1, ByVal VarPtr(abBuffer(0)), nBytes - 1, 0&, 0&)
    Utf8BytesFromString = abBuffer
End Function


Public Function crc8(buffer As String, Polynom, Initial As Variant) As Variant
CRC8_Table = Array(&H0, &H7, &HE, &H9, &H1C, &H1B, &H12, &H15, _
    &H38, &H3F, &H36, &H31, &H24, &H23, &H2A, &H2D, &H70, &H77, &H7E, &H79, &H6C, &H6B, &H62, &H65, _
    &H48, &H4F, &H46, &H41, &H54, &H53, &H5A, &H5D, &HE0, &HE7, &HEE, &HE9, &HFC, &HFB, &HF2, &HF5, _
    &HD8, &HDF, &HD6, &HD1, &HC4, &HC3, &HCA, &HCD, &H90, &H97, &H9E, &H99, &H8C, &H8B, &H82, &H85, _
    &HA8, &HAF, &HA6, &HA1, &HB4, &HB3, &HBA, &HBD, &HC7, &HC0, &HC9, &HCE, &HDB, &HDC, &HD5, &HD2, _
    &HFF, &HF8, &HF1, &HF6, &HE3, &HE4, &HED, &HEA, &HB7, &HB0, &HB9, &HBE, &HAB, &HAC, &HA5, &HA2, _
    &H8F, &H88, &H81, &H86, &H93, &H94, &H9D, &H9A, &H27, &H20, &H29, &H2E, &H3B, &H3C, &H35, &H32, _
    &H1F, &H18, &H11, &H16, &H3, &H4, &HD, &HA, &H57, &H50, &H59, &H5E, &H4B, &H4C, &H45, &H42, _
    &H6F, &H68, &H61, &H66, &H73, &H74, &H7D, &H7A, &H89, &H8E, &H87, &H80, &H95, &H92, &H9B, &H9C, _
    &HB1, &HB6, &HBF, &HB8, &HAD, &HAA, &HA3, &HA4, &HF9, &HFE, &HF7, &HF0, &HE5, &HE2, &HEB, &HEC, _
    &HC1, &HC6, &HCF, &HC8, &HDD, &HDA, &HD3, &HD4, &H69, &H6E, &H67, &H60, &H75, &H72, &H7B, &H7C, _
    &H51, &H56, &H5F, &H58, &H4D, &H4A, &H43, &H44, &H19, &H1E, &H17, &H10, &H5, &H2, &HB, &HC, _
    &H21, &H26, &H2F, &H28, &H3D, &H3A, &H33, &H34, &H4E, &H49, &H40, &H47, &H52, &H55, &H5C, &H5B, _
    &H76, &H71, &H78, &H7F, &H6A, &H6D, &H64, &H63, &H3E, &H39, &H30, &H37, &H22, &H25, &H2C, &H2B, _
    &H6, &H1, &H8, &HF, &H1A, &H1D, &H14, &H13, &HAE, &HA9, &HA0, &HA7, &HB2, &HB5, &HBC, &HBB, _
    &H96, &H91, &H98, &H9F, &H8A, &H8D, &H84, &H83, &HDE, &HD9, &HD0, &HD7, &HC2, &HC5, &HCC, &HCB, _
    &HE6, &HE1, &HE8, &HEF, &HFA, &HFD, &HF4, &HF3)
 
  Dim data As Variant
    data = Utf8BytesFromString(buffer)
  Dim alen, i As Integer
  Dim crc As Byte
  'data = Buffer ':= TEncoding.UTF8.GetBytes(Cadena);
  alen = UBound(data)
  crc = 0
    
  For i = 0 To alen
    crc = CRC8_Table((crc Xor data(i)) And &HFF)
   
Next
    crc8 = crc And &HFF



End Function
Para llamar a la función y que te devuelva en cr8:
cr8 = crc8(Cadena_enviada, 7, 0)


iNITIAL Y POLYNOM CREO QUE PUEDES OBVIARLAS

Pues te lo agradezco muchisimo! me esta dando fallo en la linea

Código:
nBytes = WideCharToMultiByte(CP_UTF8, 0&, ByVal StrPtr(strInput), -1, 0&, 0&, 0&, 0&)
Exactamente en WideCharToMultiByte
Subo la funcion en si:
Código:
 Private Declare Function WideCharToMultiByte Lib "kernel32" (
      ByVal CodePage As Long,
      ByVal dwFlags As Long,
      ByVal lpWideCharStr As Long,
      ByVal cchWideChar As Long,
      ByVal lpMultiByteStr As Long,
      ByVal cbMultiByte As Long,
      ByVal lpDefaultChar As Long,
      ByVal lpUsedDefaultChar As Long) As Long

    Dim CRC8_Table As Object
    ' CodePage constant for UTF-8
    Private Const CP_UTF8 = 65001
Tambien me da error aqui(Exactamente en Array(Es un tipo de clase y no se puede usar como una expresion)):
Código:
Public Function crc8(buffer As String, Polynom As Object, Initial As Object) As Object
        CRC8_Table = Array(&H0, &H7, &HE, &H9, &H1C, &H1B, &H12, &H15,
            &H38, &H3F, &H36, &H31, &H24, &H23, &H2A, &H2D, &H70, &H77, &H7E, &H79, &H6C, &H6B, &H62, &H65,
            &H48, &H4F, &H46, &H41, &H54, &H53, &H5A, &H5D, &HE0, &HE7, &HEE, &HE9, &HFC, &HFB, &HF2, &HF5,
            &HD8, &HDF, &HD6, &HD1, &HC4, &HC3, &HCA, &HCD, &H90, &H97, &H9E, &H99, &H8C, &H8B, &H82, &H85,
            &HA8, &HAF, &HA6, &HA1, &HB4, &HB3, &HBA, &HBD, &HC7, &HC0, &HC9, &HCE, &HDB, &HDC, &HD5, &HD2,
            &HFF, &HF8, &HF1, &HF6, &HE3, &HE4, &HED, &HEA, &HB7, &HB0, &HB9, &HBE, &HAB, &HAC, &HA5, &HA2,
            &H8F, &H88, &H81, &H86, &H93, &H94, &H9D, &H9A, &H27, &H20, &H29, &H2E, &H3B, &H3C, &H35, &H32,
            &H1F, &H18, &H11, &H16, &H3, &H4, &HD, &HA, &H57, &H50, &H59, &H5E, &H4B, &H4C, &H45, &H42,
            &H6F, &H68, &H61, &H66, &H73, &H74, &H7D, &H7A, &H89, &H8E, &H87, &H80, &H95, &H92, &H9B, &H9C,
            &HB1, &HB6, &HBF, &HB8, &HAD, &HAA, &HA3, &HA4, &HF9, &HFE, &HF7, &HF0, &HE5, &HE2, &HEB, &HEC,
            &HC1, &HC6, &HCF, &HC8, &HDD, &HDA, &HD3, &HD4, &H69, &H6E, &H67, &H60, &H75, &H72, &H7B, &H7C,
            &H51, &H56, &H5F, &H58, &H4D, &H4A, &H43, &H44, &H19, &H1E, &H17, &H10, &H5, &H2, &HB, &HC,
            &H21, &H26, &H2F, &H28, &H3D, &H3A, &H33, &H34, &H4E, &H49, &H40, &H47, &H52, &H55, &H5C, &H5B,
            &H76, &H71, &H78, &H7F, &H6A, &H6D, &H64, &H63, &H3E, &H39, &H30, &H37, &H22, &H25, &H2C, &H2B,
            &H6, &H1, &H8, &HF, &H1A, &H1D, &H14, &H13, &HAE, &HA9, &HA0, &HA7, &HB2, &HB5, &HBC, &HBB,
            &H96, &H91, &H98, &H9F, &H8A, &H8D, &H84, &H83, &HDE, &HD9, &HD0, &HD7, &HC2, &HC5, &HCC, &HCB,
            &HE6, &HE1, &HE8, &HEF, &HFA, &HFD, &HF4, &HF3)

        Dim data As Object
        data = Utf8BytesFromString(buffer)
        Dim alen, i As Integer
        Dim crc As Byte
        'data = Buffer ':= TEncoding.UTF8.GetBytes(Cadena);
        alen = UBound(data)
        crc = 0

        For i = 0 To alen
            crc = CRC8_Table((crc Xor data(i)) And &HFF)

        Next

        crc8 = crc And &HFF

    End Function
Responder Con Cita
  #4  
Antiguo 22-09-2021
ermendalenda ermendalenda is offline
Miembro
 
Registrado: ago 2021
Posts: 2.766
Poder: 8
ermendalenda Va por buen camino
Cita:
Empezado por Ramon88 Ver Mensaje
Pues te lo agradezco muchisimo! me esta dando fallo en la linea

Código:
nBytes = WideCharToMultiByte(CP_UTF8, 0&, ByVal StrPtr(strInput), -1, 0&, 0&, 0&, 0&)
Exactamente en WideCharToMultiByte
Subo la funcion en si:
Código:
 Private Declare Function WideCharToMultiByte Lib "kernel32" (
      ByVal CodePage As Long,
      ByVal dwFlags As Long,
      ByVal lpWideCharStr As Long,
      ByVal cchWideChar As Long,
      ByVal lpMultiByteStr As Long,
      ByVal cbMultiByte As Long,
      ByVal lpDefaultChar As Long,
      ByVal lpUsedDefaultChar As Long) As Long

    Dim CRC8_Table As Object
    ' CodePage constant for UTF-8
    Private Const CP_UTF8 = 65001
Tambien me da error aqui(Exactamente en Array(Es un tipo de clase y no se puede usar como una expresion)):
Código:
Public Function crc8(buffer As String, Polynom As Object, Initial As Object) As Object
        CRC8_Table = Array(&H0, &H7, &HE, &H9, &H1C, &H1B, &H12, &H15,
            &H38, &H3F, &H36, &H31, &H24, &H23, &H2A, &H2D, &H70, &H77, &H7E, &H79, &H6C, &H6B, &H62, &H65,
            &H48, &H4F, &H46, &H41, &H54, &H53, &H5A, &H5D, &HE0, &HE7, &HEE, &HE9, &HFC, &HFB, &HF2, &HF5,
            &HD8, &HDF, &HD6, &HD1, &HC4, &HC3, &HCA, &HCD, &H90, &H97, &H9E, &H99, &H8C, &H8B, &H82, &H85,
            &HA8, &HAF, &HA6, &HA1, &HB4, &HB3, &HBA, &HBD, &HC7, &HC0, &HC9, &HCE, &HDB, &HDC, &HD5, &HD2,
            &HFF, &HF8, &HF1, &HF6, &HE3, &HE4, &HED, &HEA, &HB7, &HB0, &HB9, &HBE, &HAB, &HAC, &HA5, &HA2,
            &H8F, &H88, &H81, &H86, &H93, &H94, &H9D, &H9A, &H27, &H20, &H29, &H2E, &H3B, &H3C, &H35, &H32,
            &H1F, &H18, &H11, &H16, &H3, &H4, &HD, &HA, &H57, &H50, &H59, &H5E, &H4B, &H4C, &H45, &H42,
            &H6F, &H68, &H61, &H66, &H73, &H74, &H7D, &H7A, &H89, &H8E, &H87, &H80, &H95, &H92, &H9B, &H9C,
            &HB1, &HB6, &HBF, &HB8, &HAD, &HAA, &HA3, &HA4, &HF9, &HFE, &HF7, &HF0, &HE5, &HE2, &HEB, &HEC,
            &HC1, &HC6, &HCF, &HC8, &HDD, &HDA, &HD3, &HD4, &H69, &H6E, &H67, &H60, &H75, &H72, &H7B, &H7C,
            &H51, &H56, &H5F, &H58, &H4D, &H4A, &H43, &H44, &H19, &H1E, &H17, &H10, &H5, &H2, &HB, &HC,
            &H21, &H26, &H2F, &H28, &H3D, &H3A, &H33, &H34, &H4E, &H49, &H40, &H47, &H52, &H55, &H5C, &H5B,
            &H76, &H71, &H78, &H7F, &H6A, &H6D, &H64, &H63, &H3E, &H39, &H30, &H37, &H22, &H25, &H2C, &H2B,
            &H6, &H1, &H8, &HF, &H1A, &H1D, &H14, &H13, &HAE, &HA9, &HA0, &HA7, &HB2, &HB5, &HBC, &HBB,
            &H96, &H91, &H98, &H9F, &H8A, &H8D, &H84, &H83, &HDE, &HD9, &HD0, &HD7, &HC2, &HC5, &HCC, &HCB,
            &HE6, &HE1, &HE8, &HEF, &HFA, &HFD, &HF4, &HF3)

        Dim data As Object
        data = Utf8BytesFromString(buffer)
        Dim alen, i As Integer
        Dim crc As Byte
        'data = Buffer ':= TEncoding.UTF8.GetBytes(Cadena);
        alen = UBound(data)
        crc = 0

        For i = 0 To alen
            crc = CRC8_Table((crc Xor data(i)) And &HFF)

        Next

        crc8 = crc And &HFF

    End Function
Te dejo un ejecutable para que lo uses
Archivos Adjuntos
Tipo de Archivo: rar cr.rar (7,7 KB, 19 visitas)
Responder Con Cita
  #5  
Antiguo 23-09-2021
Avatar de keys
keys keys is offline
Miembro
 
Registrado: sep 2003
Ubicación: Bilbao
Posts: 1.238
Poder: 25
keys Va por buen camino
En nuestro caso nos hemos encontrado con ordenadores que "wmic bios get serialnumber" no devuelve nada. Es mas en nuestro caso al obtener el certificado de dispositivo en Izenpe no encontraron ningún número que le proporcionara el equipo. Al final nos hicieron abrir el equipo y mirar el numero de seire que trae la palaca base en una pegatina.

Por lo tanto el numero de seire del dispositivo puede ser cualquier cosa. Nosotros lo que hacemos es que si utiliza un certificado de dispositivo nos tiene que indicar el uaurio el número de serie que le ha otrogado la entidad certificadora.
Responder Con Cita
  #6  
Antiguo 23-09-2021
Avatar de HerensugeBeltz
HerensugeBeltz HerensugeBeltz is offline
Miembro
 
Registrado: may 2021
Ubicación: Hondarribia
Posts: 90
Poder: 6
HerensugeBeltz Va por buen camino
Cita:
Empezado por keys Ver Mensaje
En nuestro caso nos hemos encontrado con ordenadores que "wmic bios get serialnumber" no devuelve nada. Es mas en nuestro caso al obtener el certificado de dispositivo en Izenpe no encontraron ningún número que le proporcionara el equipo. Al final nos hicieron abrir el equipo y mirar el numero de seire que trae la palaca base en una pegatina.

Por lo tanto el numero de seire del dispositivo puede ser cualquier cosa.
¿Habéis probado wmic baseboard get serialnumber?
Debería daros el nº de serie de la placa, que debería coincidir con el de la pegatina.
Responder Con Cita
  #7  
Antiguo 23-09-2021
ermendalenda ermendalenda is offline
Miembro
 
Registrado: ago 2021
Posts: 2.766
Poder: 8
ermendalenda Va por buen camino
Cita:
Empezado por HerensugeBeltz Ver Mensaje
¿Habéis probado wmic baseboard get serialnumber?
Debería daros el nº de serie de la placa, que debería coincidir con el de la pegatina.
Está bien tenerlo, también la da el ejecutable y fuentes de lo que he subido.
Responder Con Cita
  #8  
Antiguo 24-09-2021
Avatar de keys
keys keys is offline
Miembro
 
Registrado: sep 2003
Ubicación: Bilbao
Posts: 1.238
Poder: 25
keys Va por buen camino
Cita:
Empezado por HerensugeBeltz Ver Mensaje
¿Habéis probado wmic baseboard get serialnumber?
Debería daros el nº de serie de la placa, que debería coincidir con el de la pegatina.
Probamos de mil maneras y no había nada que devolviera un número. Tambien lo intentaron los de Izenpe y al final obtaron por lo de mirar la pegatina de la placa.
Responder Con Cita
  #9  
Antiguo 23-09-2021
Ramon88 Ramon88 is offline
Miembro
 
Registrado: ago 2021
Posts: 157
Poder: 6
Ramon88 Va por buen camino
Cita:
Empezado por ermendalenda Ver Mensaje
Te dejo un ejecutable para que lo uses

Eres increible, muchas gracias!
Responder Con Cita
  #10  
Antiguo 23-09-2021
Pau Haro Pau Haro is offline
Miembro
 
Registrado: mar 2021
Posts: 13
Poder: 0
Pau Haro Va por buen camino
Problemas al enviar TicketBAI a Alava con Java

Buenas,

Estoy intentado enviar facturas al servicio de TicketBAI de Alava usando Java, anteriormente ya hemos enviado satisfactoriamente facturas a las diputaciones de Gipuzkoa y Bizkaia. Pero ahora con Alava, no podemos ya que el Java nos pide tener el certificado X.509 dentro del JKS "Java KeyStore" para poder comunicarse de forma segura. ¿Alguien que este usando Java y que haya tenido el mismo problema con Alava?

Tampoco puedo descargar el certificado directamente desde la URL del servicio como hice con Gipuzkoa y Bizkaia ya que la pagina ni me carga, así que no se que hacer exactamente.

Muchas gracias!
Responder Con Cita
  #11  
Antiguo 23-09-2021
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.459
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por ermendalenda Ver Mensaje
Te dejo un ejecutable para que lo uses

En otro de los hilos tiene disponible lo mismo, pero en DLL (y el ejemplo de llamada), por si te puede servir.
https://www.clubdelphi.com/foros/sho...&postcount=607
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #12  
Antiguo 23-09-2021
ermendalenda ermendalenda is offline
Miembro
 
Registrado: ago 2021
Posts: 2.766
Poder: 8
ermendalenda Va por buen camino
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
En otro de los hilos tiene disponible lo mismo, pero en DLL (y el ejemplo de llamada), por si te puede servir.
https://www.clubdelphi.com/foros/sho...&postcount=607
Gracias, esta bieen saberlo y que haya variedad.
Responder Con Cita
  #13  
Antiguo 23-09-2021
Ramon88 Ramon88 is offline
Miembro
 
Registrado: ago 2021
Posts: 157
Poder: 6
Ramon88 Va por buen camino
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
En otro de los hilos tiene disponible lo mismo, pero en DLL (y el ejemplo de llamada), por si te puede servir.
https://www.clubdelphi.com/foros/sho...&postcount=607

No puedo usar la DLL.
Error:
Asegurese de que tiene acceso al archivo y de que es un ensamblado o componente COM válido.
Responder Con Cita
  #14  
Antiguo 23-09-2021
ermendalenda ermendalenda is offline
Miembro
 
Registrado: ago 2021
Posts: 2.766
Poder: 8
ermendalenda Va por buen camino
Cita:
Empezado por Ramon88 Ver Mensaje
No puedo usar la DLL.
Error:
Asegurese de que tiene acceso al archivo y de que es un ensamblado o componente COM válido.
Mira si tienes una carpeta en \Windows\syswow64 y registra la ahí
Si y tuviera más capacidad para subirlo te subiria el instalador de la dll

Última edición por ermendalenda fecha: 23-09-2021 a las 16:54:16.
Responder Con Cita
  #15  
Antiguo 23-09-2021
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.459
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por Ramon88 Ver Mensaje
No puedo usar la DLL.
Error:
Asegurese de que tiene acceso al archivo y de que es un ensamblado o componente COM válido.

Pues he vuelto a probar lo que hay en el ZIP y me funciona.
Tienes la DLL, el EXE que la llama y el código fuente.


Puedes probar a hacer un proyecto nuevo con la llamada. Es sencillo:


Código Delphi [-]
program testDLL;

{$APPTYPE CONSOLE}

{$R *.res}


uses
  ShareMem,
  Vcl.forms,
  WinAPI.Windows,
  VCL.Dialogs,
  System.SysUtils;

type
  TfunctionCRC8S = function(const AText:string): byte;
  TfunctionCRC8P = function(const AText:PAnsiChar): byte;

var
  str, fName:String;
  b:byte;
  h:cardinal;
  fs:TfunctionCRC8S;
  fp:TfunctionCRC8P;
begin

  // Nombre
  fName := ExtractFilePath(Application.ExeName) + 'crc8.dll';
  // comprobamos si existe, si no existe ya no continuamos
  if not FileExists(fName) then
    raise Exception.Create('No se encuentra la DLL  en: ' + sLineBreak + fName);
  // Cargar la DLL
  h := LoadLibrary(PChar(fName));
  if (h < 32) then
    raise Exception.Create('No se ha podido cargar la DLL');

  // buscar los métodos dentro de la DLL
  fs := GetProcAddress(h, 'crc8S');
  fp := GetProcAddress(h, 'crc8P');
  // Los ha encontrado
  if Assigned(fs) and Assigned(fp) then begin

    WriteLn('Escribir cadena de entrada o vacío para salir: ');
    ReadLn(Str);
    while (Str <> string.empty) do begin

      // Probarlo con parámetro string
      b := fs(Str);
      WriteLn('Cadena de entrada: ' + str);
      writeLn('Salida (string): ' + string.Format('%.3d',[b]));
      writeLn('-------------------------------');

      // Parámetro AnsiChar
      b := fp(PAnsiChar(Str));
      WriteLn('Cadena de entrada: ' + str);
      writeLn('Salida (PAnsiChar): ' + string.Format('%.3d',[b]));
      writeLn('-------------------------------');
      writeln(' ');

      // vuelta a empezar...
      WriteLn('Escribir cadena de entrada o vacío para salir: ');
      readLn(Str);
    end;
  end;
end.


¿Lo has probado con el EXE?
¿Estás llamando a la DLL desde otro lenguaje?
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
SII -Nuevo sistema de la Agencia Tributaria española de envío de datos vía Webservice newtron Internet 3716 19-01-2026 20:01:34
Como utilizar la ayuda del nuevo Sistema Operativo gluglu Humor 3 24-09-2007 09:39:05
Aplicacion Agencia De Viajes ArdiIIa Varios 9 20-01-2007 16:49:53
El Vasco Aguirre Al González La Taberna 5 26-05-2006 09:22:28
Microsoft ha lanzado su nuevo sistema operativo DarkByte Humor 0 25-01-2004 09:21:14


La franja horaria es GMT +2. Ahora son las 01:24:43.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi