Edit

Share via


MLKem.TryExportPkcs8PrivateKey(Span<Byte>, Int32) Method

Definition

Attempts to export the current key in the PKCS#8 PrivateKeyInfo format into the provided buffer.

public:
 bool TryExportPkcs8PrivateKey(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
[System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten);
public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten);
[<System.Diagnostics.CodeAnalysis.Experimental("SYSLIB5006", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.TryExportPkcs8PrivateKey : Span<byte> * int -> bool
member this.TryExportPkcs8PrivateKey : Span<byte> * int -> bool
Public Function TryExportPkcs8PrivateKey (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

Parameters

destination
Span<Byte>

The buffer to receive the PKCS#8 PrivateKeyInfo value.

bytesWritten
Int32

When this method returns, contains the number of bytes written to the destination buffer.

This parameter is treated as uninitialized.

Returns

true if destination was large enough to hold the result; otherwise, false.

Attributes

Exceptions

This instance has been disposed.

An error occurred while exporting the key.

Applies to