QuickOPC User's Guide and Reference
GetCertificateSubjectName Method (IEasyUAApplicationExtension)
Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.Application.Extensions Namespace > IEasyUAApplicationExtension Class : GetCertificateSubjectName Method
Gets the subject distinguished name the application is configured to use for its certificates.
Syntax
'Declaration
 
<ExtensionAttribute()>
<NotNullAttribute()>
Public Shared Function GetCertificateSubjectName( _
   ByVal application As IEasyUAApplication _
) As String
'Usage
 
Dim application As IEasyUAApplication
Dim value As String
 
value = IEasyUAApplicationExtension.GetCertificateSubjectName(application)
[Extension()]
[NotNull()]
public static string GetCertificateSubjectName( 
   IEasyUAApplication application
)
[Extension()]
[NotNull()]
public:
static String^ GetCertificateSubjectName( 
   IEasyUAApplication^ application
) 

Parameters

application

Return Value

Returns the subject distinguished name.
Exceptions
ExceptionDescription
A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.
The OPC UA operation has failed.
Example
// Shows how to get the subject name of application certificates.

using System;
using Microsoft.Extensions.DependencyInjection;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.Application;
using OpcLabs.EasyOpc.UA.Application.Extensions;

namespace UADocExamples.Application._IEasyUAClientApplication
{
    class GetCertificateSubjectName
    {
        public static void Main1()
        {
            // Obtain the client application service.
            var client = new EasyUAClient();
            IEasyUAClientApplication clientApplication = client.GetService<IEasyUAClientApplication>();

            // Get the subject name of application certificates.
            string certificateSubjectName = clientApplication.GetCertificateSubjectName();

            // Display results
            Console.WriteLine("Certificate subject name: {0}", certificateSubjectName);
        }
    }
}
// Shows how to get the subject name of application certificates.

class procedure GetCertificateSubjectName.Main;
var
  CertificateSubjectName: string;
  Client: _EasyUAClient;
  ClientApplication: _EasyUAClientApplication;
begin
  // Obtain the client application service.
  Client := CoEasyUAClient.Create;
  ClientApplication := IInterface(Client.GetServiceByName('OpcLabs.EasyOpc.UA.Application.IEasyUAClientApplication, OpcLabs.EasyOpcUA')) as _EasyUAClientApplication;

  // Get the subject name of application certificates.
  CertificateSubjectName := ClientApplication.GetCertificateSubjectName();

  // Display results
  WriteLn('Certificate subject name: ', CertificateSubjectName);
end;
' Shows how to get the subject name of application certificates.

Imports Microsoft.Extensions.DependencyInjection
Imports OpcLabs.EasyOpc.UA
Imports OpcLabs.EasyOpc.UA.Application
Imports OpcLabs.EasyOpc.UA.Application.Extensions

Namespace UADocExamples.Application._IEasyUAClientApplication
    Friend Class GetCertificateSubjectName
        Public Shared Sub Main1()
            ' Obtain the client application service.
            Dim client = New EasyUAClient()
            Dim clientApplication = client.GetService(Of IEasyUAClientApplication)()

            ' Get the subject name of application certificates.
            Dim certificateSubjectName = clientApplication.GetCertificateSubjectName()

            ' Display results
            Console.WriteLine("Certificate subject name: {0}", certificateSubjectName)
        End Sub
    End Class
End Namespace
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2012 R2, Windows Server 2016; .NET Core, .NET 6: Linux, macOS, Microsoft Windows

See Also