OPC Studio User's Guide and Reference
GetSerialNumberByteArray Method (_PkiCertificate)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security.Cryptography.PkiCertificates.ComTypes Namespace > _PkiCertificate Interface : GetSerialNumberByteArray Method
Same as System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumber. Returns the serial number of the PKI certificate as an array of bytes in little-endian order.
Syntax
'Declaration
 
<NotNullAttribute()>
Function GetSerialNumberByteArray() As Object()
'Usage
 
Dim instance As _PkiCertificate
Dim value() As Object
 
value = instance.GetSerialNumberByteArray()
[NotNull()]
object[] GetSerialNumberByteArray()
[NotNull()]
array<Object^>^ GetSerialNumberByteArray(); 

Return Value

The serial number of the PKI certificate as an array of bytes in little-endian order.

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

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.

Remarks

This method has been introduced as an alternative way to achieve the functionality of System.Security.Cryptography.X509Certificates.X509Certificate.GetSerialNumber for some COM consumers (such as Microsoft C++ native COM support #import), where the automatically generated getter function for the System.Security.Cryptography.X509Certificates.X509Certificate2.SerialNumber property becomes GetSerialNumber, causing a conflict.

This member or type is for use from COM. It is not meant to be used from .NET or Python. Refer to the corresponding .NET member or type instead, if you are developing in .NET or Python.

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