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



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.Security.Cryptography.PkiCertificates Namespace > IPkiCertificate 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 Byte()
'Usage
 
Dim instance As IPkiCertificate
Dim value() As Byte
 
value = instance.GetSerialNumberByteArray()
[NotNull()]
byte[] GetSerialNumberByteArray()
[NotNull()]
array<byte>^ 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).

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.

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