Ver Mensaje Individual
  #4  
Antiguo 24-09-2014
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
shoulder,

Cita:
Empezado por shoulder
...no logro en Delphi la función (Método) SignedData.Verify del CAPICOM para verificar si un pdf esta firmado...


Revisa este código:
Código Delphi [-]
 function TDigital_CAPICOM.VerifySign(const AFileName: string): Boolean;  
 var  
   SignedData: ISignedData;  
   HashString: WideString;  
   ASignedContent: string;  
 begin  
   Result := True;  
   try  
     GetCertificate;  
     //先获取签名信息,因为会做信息分离,还原出加上签名前的数据   
     ASignedContent:= ExtractSignedContent(AFileName);  
     //获取文件哈希值   
     HashString:= GetFileHash(AFileName);  
     //构建 数据签名对象   
     SignedData := CoSignedData.Create;  
     SignedData.Content := HashString;  
     //执行检查   
     SignedData.Verify(ASignedContent, False, CAPICOM_VERIFY_SIGNATURE_ONLY);  
   except  
     Result := False;  
     Raise Exception.Create('数字签名校验失败!');  
   end;  
 end;
Tomado de : delphi实现数字签名

Revisa esta información:
Espero sea útil

Nelson.

Última edición por nlsgarcia fecha: 24-09-2014 a las 04:48:30.
Responder Con Cita