Quantcast
Viewing all articles
Browse latest Browse all 1794

How to set client certificate parameters; examples in VBA, VBScript, C# - by: support

The default behavior of QuickOPC is to automatically generate a "subject name" for the instance certificate of the UA client application. QuickOPC then attempts to locate the certificate using this subject name in the certificate store, and if it finds such certificate, it uses it. If it does not find such certificate, it creates it and places it into the certificate store (so that it can be found next time, and not re-created).

If you want to provide your own certificate to be used by QuickOPC as UA client certificate, you either need to generate it with the subject name that QuickOPC uses (beware: it may change depending on conditions such as your assembly version and name!), or choose your own name, and instruct QuickOPC to use that name.

Here is an information on how to achieve it:
In general, you just need to set the ApplicationName property in EasyUAClient.SharedParameters.EngineParameters to the desired certificate subject. This can be directly in .NET, but because static properties are not supported in COM, it has to be done via the EasyUAClientConfiguration object in tools such as VBScript, VB6, VBA (Excel, ...), Delphi etc.

Code examples follow, and are also in attachments.

C#:




[File Attachment: Clientcertificateparameters.linq]


VBScript:




[File Attachment: _EasyUAEngineParameters.ApplicationName.Main.vbs]



VBA (in Excel):





[File Attachment: UAClientCertificateParameters.xls]


Note: Some earlier QuickOPC versions had a bug which caused the changes to shared parameters be ignored. If you observe such problem, download QuickOPC 5.40.281.1 or later, and rebuild your project with the new assemblies.

Viewing all articles
Browse latest Browse all 1794

Trending Articles