ECAlgorithm.TryExportECPrivateKeyPem(Span<Char>, Int32) 方法

定义

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

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

参数

destination
Span<Char>

要接收 PEM 编码的 ECPrivateKey 数据的字符范围。

charsWritten
Int32

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

返回

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

例外

未能导出密钥。

注解

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

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

适用于