Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
Creating client cert with customized start and end dates
Please Log in or Create an account to join the conversation.
- sjscheider
-
Topic Author
- Offline
- Platinum Member
-
- Posts: 40
- Thank you received: 2
Please Log in or Create an account to join the conversation.
I did a quick check - not sure if I have understood everything right, take it with some reservation. But normally, the "-lifetimeInMonths" is used to control the cert validity. But, there also seems to be "-startTime" switch, maybe that's what you are looking for.
QuickOPC relies on OPC Foundation stack/SDK for cert generation. When QuickOPC runs under .NET Framework, it means that the (now) so-called .NET "legacy" stack used, and it calls the UA certificate generator (as separate EXE) from inside the C# code. So, there is no true C# code for cert generation to speak of.
When QuickOPC runs under .NET Core, it is based on the OPC Foundation's .NET Standard stack, for which you can find the source code here: github.com/OPCFoundation/UA-.NETStandard . The C# cert generation code should be in there.
Regards
Please Log in or Create an account to join the conversation.
- sjscheider
-
Topic Author
- Offline
- Platinum Member
-
- Posts: 40
- Thank you received: 2
I did figure out how to specify a cert I generated to be used by QuickOPC, but I still can't seem to generate a valid cert using C#. I've also tried generating the cert via C# but the certs I'm generating are coming back as invalid. Do you have some sample code you use to generate the certs? I was not able to identify it in the source code I downloaded.
Please Log in or Create an account to join the conversation.
1. Determines the name of the client certificate and where it should be stored
2. Looks up the certificate, and if found, uses it
3. When not found, determines parameters of the certificate, generates it and then uses it.
In Step 3, *some* of the certificate info is controllable by parameters that you can set on the EasyUAClient class, but definitely not all of them. Start and end of validity cannot be controlled.
If you want your client app to use such certificate, you need to create it by other means, store it into the appropriate certificate store. The name must match - this can be achieved either by generating a certificate with a name that matches that automatically chosen name by QuickOPC, OR by selecting a name of your wish, and then setting the appropriate parameter in EasyUAClient to use that name when looking up the certificate.
OPC Foundation's certificate generator (command-line based) can be found on GitHub.
Best regards
Please Log in or Create an account to join the conversation.
- sjscheider
-
Topic Author
- Offline
- Platinum Member
-
- Posts: 40
- Thank you received: 2
If yes, how?
If no, can you recommend any C# code to do so? I've tried but the cert is not being expected on the server and I'm not exactly sure what I'm missing.
Please Log in or Create an account to join the conversation.