mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 08:15:53 +01:00
86 lines
2.0 KiB
ObjectPascal
86 lines
2.0 KiB
ObjectPascal
unit Net.CrossSslSocket.Base;
|
|
|
|
interface
|
|
|
|
uses
|
|
Net.CrossSocket.Base;
|
|
|
|
type
|
|
/// <summary>
|
|
/// SSL Socket
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// 正确的使用步骤:
|
|
/// <list type="number">
|
|
/// <item>
|
|
/// SetCertificateificate 或 SetCertificateificateFile
|
|
/// </item>
|
|
/// <item>
|
|
/// SetPrivateKey 或 SetPrivateKeyFile, 客户端不需要这一步
|
|
/// </item>
|
|
/// <item>
|
|
/// Connect / Listen
|
|
/// </item>
|
|
/// </list>
|
|
/// </remarks>
|
|
ICrossSslSocket = interface(ICrossSocket)
|
|
['{A4765486-A0F1-4EFD-BC39-FA16AED21A6A}']
|
|
/// <summary>
|
|
/// 从内存加载证书
|
|
/// </summary>
|
|
/// <param name="ACertBuf">
|
|
/// 证书缓冲区
|
|
/// </param>
|
|
/// <param name="ACertBufSize">
|
|
/// 证书缓冲区大小
|
|
/// </param>
|
|
procedure SetCertificate(const ACertBuf: Pointer; const ACertBufSize: Integer); overload;
|
|
|
|
/// <summary>
|
|
/// 从字符串加载证书
|
|
/// </summary>
|
|
/// <param name="ACertStr">
|
|
/// 证书字符串
|
|
/// </param>
|
|
procedure SetCertificate(const ACertStr: string); overload;
|
|
|
|
/// <summary>
|
|
/// 从文件加载证书
|
|
/// </summary>
|
|
/// <param name="ACertFile">
|
|
/// 证书文件
|
|
/// </param>
|
|
procedure SetCertificateFile(const ACertFile: string);
|
|
|
|
/// <summary>
|
|
/// 从内存加载私钥
|
|
/// </summary>
|
|
/// <param name="APKeyBuf">
|
|
/// 私钥缓冲区
|
|
/// </param>
|
|
/// <param name="APKeyBufSize">
|
|
/// 私钥缓冲区大小
|
|
/// </param>
|
|
procedure SetPrivateKey(const APKeyBuf: Pointer; const APKeyBufSize: Integer); overload;
|
|
|
|
/// <summary>
|
|
/// 从字符串加载私钥
|
|
/// </summary>
|
|
/// <param name="APKeyStr">
|
|
/// 私钥字符串
|
|
/// </param>
|
|
procedure SetPrivateKey(const APKeyStr: string); overload;
|
|
|
|
/// <summary>
|
|
/// 从文件加载私钥
|
|
/// </summary>
|
|
/// <param name="APKeyFile">
|
|
/// 私钥文件
|
|
/// </param>
|
|
procedure SetPrivateKeyFile(const APKeyFile: string);
|
|
end;
|
|
|
|
implementation
|
|
|
|
end.
|