<PackageReference Include="Azure.Core" Version="1.53.0" />

Azure.Core.PemReader

static class PemReader
Reads PEM streams to parse PEM fields or load certificates.
public enum KeyType

Key type of the certificate private key.

public struct PemField

A PEM field including its section header and encoded data.

public static X509Certificate2 LoadCertificate(ReadOnlySpan<char> data, byte[] cer = null, KeyType keyType = 0, bool allowCertificateOnly = false, X509KeyStorageFlags keyStorageFlags = 0)

Loads an X509Certificate2 from PEM data.

public static bool TryRead(ReadOnlySpan<char> data, out PemField field)

Attempts to read the next PEM field from the given data.