Apologies if this is a trivial question, but I am updating UA OPC dll's to support the latest .net using .netcoreapp3.1. Previously, we were using a static method to create a certificate given parameters: certificate path and certificate settings.
"UnitedAutomation.UaBase.CertificateFactory.Create"
With the new dll's, this seems to be deprecated. I see that there is an interface of ICertificateFactory, but it doesn't really make sense to me that I would need to implement my own version of create certificate.
How can I create a certificate with similar parameters (path and settings) using the latest OPC dll's? I am just not sure how to use the interface or the DefaultCertificateFactory, as there isn't a real implementation of either one.
3.1.1 Create Certificate
Moderator: uasdknet
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: 3.1.1 Create Certificate
Hello,
the way to call the CreateCertificate() method manually is the following:
First, set the SecurityProvider at the ApplicationInstance like shown in the Examples:
Second, create a CertificateFactory from your chosen SecurityProvider[/list]
Now, call the CreateCertificate() method at the CertificateFactory with the path and settings parameters.
the way to call the CreateCertificate() method manually is the following:
First, set the SecurityProvider at the ApplicationInstance like shown in the Examples:
- use WindowsSecurityProvider for Windows only application (provided in UaBase.Windows)
- use BounsyCastleSecurityProvider for universal usage (provided in UaBase.BouncyCastle)
Code: Select all
ApplicationInstanceBase.Default.SecurityProvider = new BouncyCastleSecurityProvider();
Code: Select all
var certificateFactory = ApplicationInstanceBase.Default.SecurityProvider.CreateCertificateFactory();
Code: Select all
var certifcate = certificateFactory.CreateCertificate(path, settings);
Best regards
Unified Automation Support Team
Unified Automation Support Team