X509Certificate2Collection.TryExportCertificatePems 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
尝试导出已编码为 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
参数
- charsWritten
- Int32
此方法返回时,写入到 destination
的字符总数。
返回
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.