-
Notifications
You must be signed in to change notification settings - Fork 1
/
CertificateGenerationThread.pas
54 lines (45 loc) · 1.27 KB
/
CertificateGenerationThread.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
unit CertificateGenerationThread;
interface
uses
Classes, SBX509;
type
TCertificateGenerationThread = class(TThread)
private
FCert : TElX509Certificate;
FCACert : TElX509Certificate;
FAlg : integer;
FDwords : integer;
public
constructor Create(CreateSuspended: Boolean); overload;
constructor Create(CACert,Cert : TElX509Certificate; SignatureAlgorithm : integer;
Dwords : integer); overload;
destructor Destroy; override;
procedure Execute; override;
property Cert : TElX509Certificate read FCert;
end;
implementation
constructor TCertificateGenerationThread.Create(CreateSuspended: Boolean);
begin
inherited Create(CreateSuspended);
end;
destructor TCertificateGenerationThread.Destroy;
begin
inherited;
end;
procedure TCertificateGenerationThread.Execute;
begin
if not Assigned(FCACert) then
FCert.Generate(FAlg, FDwords)
else FCert.Generate(FCACert,FAlg,FDwords);
end;
constructor TCertificateGenerationThread.Create(CACert,Cert : TElX509Certificate; SignatureAlgorithm : integer;
Dwords : integer);
begin
inherited Create(true);
Self.FreeOnTerminate := true;
FCert := Cert;
FCACert := CACert;
FAlg := SignatureAlgorithm;
FDwords := Dwords;
end;
end.