AsymmetricAlgorithm.TryExportSubjectPublicKeyInfo(Span<Byte>, Int32) 方法
定义
在派生的类中替代时,尝试以 X.509 SubjectPublicKeyInfo 格式将当前密钥导出到所提供的缓冲区。When overridden in a derived class, attempts to export the current key in the X.509 SubjectPublicKeyInfo format into a provided buffer.
public:
virtual bool TryExportSubjectPublicKeyInfo(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public virtual bool TryExportSubjectPublicKeyInfo (Span<byte> destination, out int bytesWritten);
abstract member TryExportSubjectPublicKeyInfo : Span<byte> * int -> bool
override this.TryExportSubjectPublicKeyInfo : Span<byte> * int -> bool
Public Overridable Function TryExportSubjectPublicKeyInfo (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean
参数
接收 X.509 SubjectPublicKeyInfo 数据的字节范围。The byte span to receive the X.509 SubjectPublicKeyInfo data.
- bytesWritten
- Int32
此方法返回时,包含一个指示写入 destination 的字节数的值。When this method returns, contains a value that indicates the number of bytes written to destination. 该参数未经初始化即被处理。This parameter is treated as uninitialized.
返回
如果 destination 具有足够的大小以接收输出,则为 true;否则为 false。true if destination is big enough to receive the output; otherwise, false.
例外
未能导出密钥。The key could not be exported.
派生的类型未替代此成员。A derived type has not overriden this member.
注解
由于生成此数据格式需要特定于算法的支持,因此 TryExportSubjectPublicKeyInfo NotImplementedException 默认情况下会引发。Because algorithm-specific support is required to produce this data format, TryExportSubjectPublicKeyInfo throws a NotImplementedException by default.