Ver Mensaje Individual
  #230  
Antiguo 02-10-2010
Morrismx Morrismx is offline
Registrado
 
Registrado: ago 2010
Posts: 6
Reputación: 0
Morrismx Va por buen camino
Edgar, asegurate de hacer los cambios a la funcion

Código Delphi [-]
function GetNoCertificado(const AFileName: string): string;
var
bp: pBIO;
fn: PAnsiChar;
x: pX509;
x509: pX509;
bn: pBIGNUM;
num: array [0..19] of AnsiChar;  <<==== Este es el cambio
begin
InitOpenSSL;
fn := PAnsiChar(ansistring(AFileName));
bp := BIO_new(BIO_s_file());
BIO_read_filename(bp, Pchar(fn));
x := X509_new;
x509 := PEM_read_bio_X509(bp, x, nil, nil);
bn := ASN1_INTEGER_to_BN(X509_get_serialNumber(x509), nil);
BN_bn2bin(bn, @num[0]);
BN_free(bn);
X509_free(x509);
BIO_free(bp);
Result := num;
EVP_cleanup;
end;

el resto de la funcion no cambia, solo reemplza Char por AnsiChar y listo

dejame saber si te funciona

saludos
Morris
Responder Con Cita