X509Certificate2Collection.TryExportCertificatePems 方法

定义

尝试导出已编码为 PEM 的公共 X.509 证书。

public:
 bool TryExportCertificatePems(Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryExportCertificatePems (Span<char> destination, out int charsWritten);
member this.TryExportCertificatePems : Span<char> * int -> bool
Public Function TryExportCertificatePems (destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

参数

destination
Span<Char>

接收 PEM 编码证书的缓冲区。

charsWritten
Int32

此方法返回时,写入到 destination的字符总数。

返回

Boolean

true 如果 destination 足够大,无法接收编码的 PEM,则为 ;否则为 false

例外

证书已损坏,处于无效状态,或无法导出到 PEM。

注解

A PEM-encoded X.509 certificate collection will contain certificates where each certificate begins with -----BEGIN CERTIFICATE----- and ends with -----END CERTIFICATE-----, with the base64 encoded DER contents of the certificate between the PEM boundaries. Each certificate is separated by a single line-feed character.

          Certificates are encoded according to the IETF RFC 7468 "strict" encoding rules.

适用于