OPC Studio User's Guide and Reference
TryNew Method



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security.Cryptography.PkiCertificates Namespace > PkiCertificate Class : TryNew Method
A byte array containing data from a PKI certificate.
Contains the newly created PKI certificate, or null in case of an error.
Attempts to create a new instance of the PKI certificate using information from a byte array.
Syntax
'Declaration
 
<CanBeNullAttribute()>
Public Shared Function TryNew( _
   ByVal rawData() As Byte, _
   ByRef pkiCertificate As PkiCertificate _
) As Exception
'Usage
 
Dim rawData() As Byte
Dim pkiCertificate As PkiCertificate
Dim value As Exception
 
value = PkiCertificate.TryNew(rawData, pkiCertificate)
[CanBeNull()]
public static Exception TryNew( 
   byte[] rawData,
   out PkiCertificate pkiCertificate
)
[CanBeNull()]
public:
static Exception^ TryNew( 
   array<byte>^ rawData,
   [Out] PkiCertificate^ pkiCertificate
) 

Parameters

rawData
A byte array containing data from a PKI certificate.
pkiCertificate
Contains the newly created PKI certificate, or null in case of an error.

Return Value

Returns null if the certificate has been successfully created. Otherwise, returns a non-nullSystem.Exception describing the error.
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