Skip to content

Erroneous information about the byte order of X509Certificate.GetSerialNumberString Method #11485

Closed
@Haaveilija

Description

@Haaveilija

Type of issue

Typo

Description

The documentation states the following:

Returns the serial number of the X.509v3 certificate as a little-endian hexadecimal string .

But actually it returns the serial number as a big-endian hexadecimal string.
Also, there should not be a space before the period in the end of the sentence.

As can be seen in the code, it indeed does return big-endian. System.Security.Cryptography.X509Certificate

public virtual string GetSerialNumberString()
{
    ThrowIfInvalid();
    // PAL always returns big-endian, GetSerialNumberString returns big-endian too
    return GetRawSerialNumber().ToHexStringUpper();
}

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate.getserialnumberstring?view=net-9.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Security.Cryptography.X509Certificates/X509Certificate.xml

Document Version Independent Id

b5dac185-ee94-6a9e-26b1-a20f314296c1

Platform Id

5259c616-e374-b907-995b-688c751cf052

Article author

@dotnet-bot

Metadata

Metadata

Assignees

Labels

area-System.SecurityIssues related to security practices for .NET developers.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions