Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToBufferMS

TElX509Certificate     See also     


Filter: C#/Java  VB.NET  Pascal  C++  PHP  


Saves the private key of the certificate to the memory buffer in form compatible with CryptoAPI PRIVATEKEYBLOB format.

Declaration

[C#/Java]
    int SaveKeyToBufferMS(out byte[] Buffer);
    int SaveKeyToBufferMS(ref byte[] Buffer, ref int Size);

[VB.NET]
    Function SaveKeyToBufferMS(Out Buffer As Byte()) As Integer
    Function SaveKeyToBufferMS(ByRef Buffer As Byte(), ByRef Size As Integer) As Integer

[Pascal]
    function SaveKeyToBufferMS(Buffer: Pointer; var Size: Integer) : integer;

[C++]
    int32_t SaveKeyToBufferMS(void * Buffer, int32_t &Size);

[PHP]
    integer SaveKeyToBufferMS(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size)

Parameters

  • Buffer - the buffer to which the private key is saved.
  • Size - the size of the buffer to which the private key is saved.When the method returns, Size parameter contains the size of the data that were saved,or, if the buffer was too small, the size of the buffer enough to hold the data.

Return value

    0 - if the key was successfully saved.
    Otherwise MS error code.

Description

    This method saves the private key to the provided memory location of the given size. If the buffer is too small (or empty), Size parameter is set to the size which will be enough to hold the whole data.

Discuss this help topic in SecureBlackbox Forum