Discuss this help topic in SecureBlackbox Forum

TElCertificateRequest.SaveKeyToBufferPVK

TElCertificateRequest     See also     


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


Saves the private key of the Certificate Request 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, 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 - influences the way the key hash is stored.

Return value

    True on success.
    False if the buffer size is too small. In this case this method sets Size parameter to the size which will be enough to hold the whole data.

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 is saved in PVK format.

StrongEncryption parameter affects the way the hash of the password is stored. In "weak" mode only 5 bytes of the SHA1 hash are stored. In "strong" mode the complete hash is stored.

See also:     SaveKeyToBuffer     SaveKeyToBufferPEM    

Discuss this help topic in SecureBlackbox Forum