dOPC Client Toolkit
Close
ua.client.TdOPCUAClient.OnGetCertificate

Occurs when Security Mode is <> None.

property OnGetCertificate: TuaGetCertificate;
__property TuaGetCertificate OnGetCertificate;

If you set SecurityMode to Sign or SignAndEncrypt you need additionally a Public Key (Certificate) and a Private Key. 

If you want to use security you need a certificate. With our example program DEMO\UA\UACreateCert you can create your own certificate. The easiest way to use it with your programs is to add the private and the public keys as a resource in your project under menu "Project-> Resources and Images". 

Add Private-Key as RCDATA and name it to: dOPCPrivateKey 

Add Public-Key as RCDATA and name it to: dOPCPublicCertificate 

If you want to load the Public Key and Private Key by your own e.g. from file then use this event.

This event is intended to be compatible with older versions. It is recommended that you use the SecurityKeyPair property for certificate handling.

function TdOPCCertForm.dOPCUAClient1GetCertificate(Sender: TObject; var PrivateKey, PublicCertificate: TStream): Boolean; var FileName: string; begin FileName := ExtractFilePath(Application.ExeName)+'OnCert'; PrivateKey := TFileStream.create(ChangeFileExt(Filename,'.pem'),fmOpenRead); PublicCertificate := TFileStream.create(ChangeFileExt(Filename,'.der'),fmOpenRead); result := true; end;
Copyright © 2001 to 2026 by Kassl GmbH.