RSA.TryExportRSAPublicKey(Span<Byte>, Int32) 方法

定义

尝试将 PKCS#1 RSAPublicKey 格式中的当前密钥导出到提供的缓冲区中。

public:
 virtual bool TryExportRSAPublicKey(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TryExportRSAPublicKey(Span<byte> destination, out int bytesWritten);
abstract member TryExportRSAPublicKey : Span<byte> * int -> bool
override this.TryExportRSAPublicKey : Span<byte> * int -> bool
Public Overridable Function TryExportRSAPublicKey (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

参数

destination
Span<Byte>

用于接收 PKCS#1 RSAPublicKey 数据的字节范围。

bytesWritten
Int32

此方法返回时,包含一个值,该值指示写入到 destination的字节数。 此参数被视为未初始化。

返回

true 如果 destination 足够大才能接收输出,则为 ;否则为 false

例外

无法导出密钥。

适用于

另请参阅