OPC Studio User's Guide and Reference
FindCertificates Method



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security.Cryptography.PkiCertificates Namespace > IPkiStore Interface : FindCertificates Method
A string representing the thumbprint of the certificate.

The value of this parameter cannot be null (Nothing in Visual Basic).

Specifies whether the certificates should be returned with their private keys.
A password to access the private key.

The value of this parameter cannot be null (Nothing in Visual Basic).

Searches the PKI store for certificates with the given thumbprint.
Syntax
'Declaration
 
<NotNullAttribute()>
Function FindCertificates( _
   ByVal thumbprint As String, _
   ByVal withPrivateKeys As Boolean, _
   ByVal password As String _
) As PkiCertificateCollection
'Usage
 
Dim instance As IPkiStore
Dim thumbprint As String
Dim withPrivateKeys As Boolean
Dim password As String
Dim value As PkiCertificateCollection
 
value = instance.FindCertificates(thumbprint, withPrivateKeys, password)

Parameters

thumbprint
A string representing the thumbprint of the certificate.

The value of this parameter cannot be null (Nothing in Visual Basic).

withPrivateKeys
Specifies whether the certificates should be returned with their private keys.
password
A password to access the private key.

The value of this parameter cannot be null (Nothing in Visual Basic).

Return Value

A collection of certificates that have the given thumbprint.

This method never returns null (Nothing in Visual Basic).

The individual elements of the returned value are never null (Nothing in Visual Basic).

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.

An error occurred during a cryptographic operation.

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.

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