delphi 连接 SSL TLS 1.2  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi 连接 SSL TLS 1.2


台湾最近银行与第三方支付、行动支付发展越来越快,而Delphi使用indy元件时,如果处理SSL网站时不是很容易。
后来找到了ipwork的元件还不错用。
列一下关键的程式
ipwhttp1 := Tipwhttp.Create(Application);
ipwhttp1.Config('CodePage=65001');
posturl:=posturl+'barcode='+sBarcode;
ipwhttp1.Post(sPaymentURL+'?'+posturl);
result:=UTF8ToString(ipwhttp1.TransferredData);
ipwhttp1.free;
另外处理像SHA/AES等加解密也很方便

function GetTokenKey(s:String):String;
var ipcHash1: TipcHash;
begin
ipcHash1 := TipcHash.Create(Application);
ipcHash1.Reset();
ipcHash1.Algorithm := TipcHashAlgorithms(haSHA256);
ipcHash1.InputMessage := s;
ipcHash1.ComputeHash();
result :=lowercase(ipcHash1.HashValue);
ipcHash1.Free;
end;

来源:http://superlevin.ifengyuan.tw/delphi-%E9%80%A3%E6%8E%A5-ssl-tls-1-2-%E7%AC%AC%E4%B8%89%E6%96%B9%E6%94%AF%E4%BB%98%E9%87%91%E6%B5%81%E5%95%8F%E9%A1%8C/

推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 1.3432650566101 seconds