forked from winddriver/Delphi-Cross-Socket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNet.CrossSslSocket.Base.pas
85 lines (75 loc) · 1.95 KB
/
Net.CrossSslSocket.Base.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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.