X509Certificate2Collection.ImportFromPem(ReadOnlySpan<Char>) Method

Definition

Imports a collection of RFC 7468 PEM-encoded certificates.

C#
public void ImportFromPem(ReadOnlySpan<char> certPem);

Parameters

certPem
ReadOnlySpan<Char>

The text of the PEM-encoded X509 certificate collection.

Exceptions

The decoded contents of a PEM are invalid or corrupt and could not be imported.

Remarks

PEM-encoded items with a CERTIFICATE PEM label will be imported. PEM items with other labels will be ignored.

More advanced scenarios for loading certificates and can leverage PemEncoding to enumerate PEM-encoded values and apply any custom loading behavior.

Applies to

Produkt Verzie
.NET 5, 6, 7, 8, 9, 10