Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToBufferPVK

TElX509Certificate     See also     


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


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

Declaration

[C#]
    int SaveKeyToBufferPVK(out byte[] Buffer, string Password, bool UseStrongEncryption);
    int SaveKeyToBufferPVK(ref byte[] Buffer, ref int Size, string Password, bool UseStrongEncryption);

[VB.NET]
    Function SaveKeyToBufferPVK(Out Buffer As Byte(), ByVal Password As String, ByVal UseStrongEncryption As Boolean) As Integer
    Function SaveKeyToBufferPVK(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal Password As String, ByVal UseStrongEncryption As Boolean) 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)

[Java]
    int saveKeyToBufferPVK(byte[][] Buffer, int[] Size, String Password, boolean UseStrongEncryption);
    int saveKeyToBufferPVK(byte[] Buffer, TSBInteger Size, String Password, boolean UseStrongEncryption);
    int saveKeyToBufferPVK(byte[][] Buffer, String Password, boolean 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