OPC Studio User's Guide and Reference
LoadCertificate Method (X509CertificateTokenInfo)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.IdentityModel.User Namespace > X509CertificateTokenInfo Class : LoadCertificate Method
Loads an X.509 certificate from the information configured in the token info.
Syntax
'Declaration
 
<NotNullAttribute()>
Public Function LoadCertificate() As ValueResult(Of PkiCertificate)
'Usage
 
Dim instance As X509CertificateTokenInfo
Dim value As ValueResult(Of PkiCertificate)
 
value = instance.LoadCertificate()
[NotNull()]
public ValueResult<PkiCertificate> LoadCertificate()
[NotNull()]
public:
ValueResult<PkiCertificate^>^ LoadCertificate(); 

Return Value

Returns the value result with the certificate loaded, based on this X.509 certificate token info.

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

Exceptions
ExceptionDescription

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.

A method call was invalid for the object's current state.

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.

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