QuickOPC User's Guide and Reference
BrowseCertificateGroups Method (IEasyUACertificateManagement)
Example 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.Gds Namespace > IEasyUACertificateManagement Interface : BrowseCertificateGroups Method
Endpoint descriptor. Identifies the OPC-UA server. The server must be a Global Directory Server (GDS).
Browses the certificate groups available in the Certificate Management information model.
Syntax
'Declaration
 
<ElementsNotNullAttribute()>
<NotNullAttribute()>
Function BrowseCertificateGroups( _
   ByVal gdsEndpointDescriptor As UAEndpointDescriptor _
) As UACertificateGroupElementCollection
'Usage
 
Dim instance As IEasyUACertificateManagement
Dim gdsEndpointDescriptor As UAEndpointDescriptor
Dim value As UACertificateGroupElementCollection
 
value = instance.BrowseCertificateGroups(gdsEndpointDescriptor)
[ElementsNotNull()]
[NotNull()]
UACertificateGroupElementCollection BrowseCertificateGroups( 
   UAEndpointDescriptor gdsEndpointDescriptor
)
[ElementsNotNull()]
[NotNull()]
UACertificateGroupElementCollection^ BrowseCertificateGroups( 
   UAEndpointDescriptor^ gdsEndpointDescriptor
) 

Parameters

gdsEndpointDescriptor
Endpoint descriptor. Identifies the OPC-UA server. The server must be a Global Directory Server (GDS).

Return Value

The method returns a certificate group element collection, which contains UACertificateGroupElement values. Each element contains information about a particular certificate group found.
Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

The OPC UA operation has failed. This operation exception in uniformly used to allow common handling of various kinds of errors. The System.Exception.InnerException always contains information about the actual error cause.

This is an operation error that depends on factors external to your program, and thus cannot be always avoided. Your code must handle it appropriately.

Example

.NET

// Shows how to browse and display the certificate groups available in the Certificate Manager.

using System;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.Gds;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples.Gds._EasyUACertificateManagementClient
{
    class BrowseCertificateGroups
    {
        public static void Main1()
        {
            // Define which GDS we will work with.
            UAEndpointDescriptor gdsEndpointDescriptor = "opc.tcp://opcua.demo-this.com:58810/GlobalDiscoveryServer";

            // Instantiate the certificate management client object.
            var certificateManagementClient = new EasyUACertificateManagementClient();

            // Browse the certificate groups available in the GDS.
            UACertificateGroupElementCollection certificateGroupElementCollection;
            try
            {
                certificateGroupElementCollection = certificateManagementClient.BrowseCertificateGroups(gdsEndpointDescriptor);
            }
            catch (UAException uaException)
            {
                Console.WriteLine("*** Failure: {0}", uaException.GetBaseException().Message);
                return;
            }

            // Display results
            foreach (UACertificateGroupElement certificateGroupElement in certificateGroupElementCollection)
            {
                Console.WriteLine(certificateGroupElement);
            }
        }
    }
}
# Shows how to browse and display the certificate groups available in the Certificate Manager.

# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from OpcLabs.EasyOpc.UA import *
from OpcLabs.EasyOpc.UA.Gds import *
from OpcLabs.EasyOpc.UA.OperationModel import *


# Define which GDS we will work with.
gdsEndpointDescriptor = UAEndpointDescriptor('opc.tcp://opcua.demo-this.com:58810/GlobalDiscoveryServer')

# Instantiate the certificate management client object.
certificateManagementClient = EasyUACertificateManagementClient()

# Browse the certificate groups available in the GDS.
try:
    certificateGroupElementCollection = certificateManagementClient.BrowseCertificateGroups(gdsEndpointDescriptor)
except UAException as uaException:
    print('*** Failure: ' + uaException.GetBaseException().Message)
    exit()

# Display results.
for certificateGroupElement in certificateGroupElementCollection:
    print(certificateGroupElement)

print()
print('Finished.')
Requirements

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

See Also