Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToBufferPVK

TElX509Certificate     See also     


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


Saves the private key of the certificate to the memory buffer in PVK format.

Declaration

[C#/Java]
    int SaveKeyToBufferPVK(out byte[] Buffer, string Password, bool UseStrongEncryption /* = true */);
    int SaveKeyToBufferPVK(ref byte[] Buffer, ref int Size, [in] string Password, bool UseStrongEncryption /* = true */);

[VB.NET]
    Function SaveKeyToBufferPVK(ByRef Buffer As Byte(), ByVal Password As String, UseStrongEncryption As Boolean = True) As Integer
    Function SaveKeyToBufferPVK(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal Password As String, UseStrongEncryption As Boolean = True) As Integer

[Pascal]
    function SaveKeyToBufferPVK(Buffer: pointer; var Size : integer; const Password : string; UseStrongEncryption: boolean = true) : integer;

[C++]
    int32_t SaveKeyToBufferPVK(void * Buffer, int32_t &Size, const std::string &Password, bool UseStrongEncryption);

[PHP]
    integer SaveKeyToBufferPVK(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size, string $Password, bool $UseStrongEncryption)

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.
  • Password - the password to encrypt the private key. If the key shouldn't be encrypted, set this parameter to empty string
  • UseStrongEncryption - determines the key length. If True the 128-bits key is used.
    False - 40-bits key.
    The default value is True.

Return value

    Returns 0 if the key was successfully saved, and a PVK error code otherwise.

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. The private key will be saved in PVK (Microsoft secret) format.

Discuss this help topic in SecureBlackbox Forum