AsymmetricAlgorithm.TryExportPkcs8PrivateKeyPem 方法

定义

尝试将 PEM 编码 PKCS#8 PrivateKeyInfo 格式的当前密钥导出到提供的缓冲区中。

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

参数

destination
Span<Char>

要接收 PEM 编码的 PKCS#8 PrivateKeyInfo 数据的字符范围。

charsWritten
Int32

此方法返回时, 包含一个值,该值指示写入 到 destination的字符数。 该参数未经初始化即被处理。

返回

如果 destination 具有足够的大小以接收输出,则为 true;否则为 false

例外

未能导出密钥。

注解

PEM 编码的 PKCS#8 PrivateKeyInfo 以 开头 -----BEGIN PRIVATE KEY----- ,以 结尾 -----END PRIVATE KEY-----,PEM 边界之间键的 base64 编码 DER 内容。

          The PEM is encoded according to the IETF RFC 7468 "strict"
          encoding rules.

适用于