Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.LoadKeyFromBufferPKCS8

TElX509Certificate     See also     


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


Loads the certificate's private key from the memory buffer. The key must be stored in PKCS8 format.

Declaration

[C#]
    int LoadKeyFromBufferPKCS8(byte[] Buffer, string Password);
    int LoadKeyFromBufferPKCS8(byte[] Buffer, int StartIndex, int Count, string Password);

[VB.NET]
    Function LoadKeyFromBufferPKCS8(ByVal Buffer As Byte(), ByVal Password As String) As Integer
    Function LoadKeyFromBufferPKCS8(ByVal Buffer As Byte(), ByVal StartIndex As Integer, ByVal Count As Integer, ByVal Password As String) As Integer

[Pascal]
    function LoadKeyFromBufferPKCS8(Buffer: pointer; Size: integer; const Password: string): integer;

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

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

[Java]
    int loadKeyFromBufferPKCS8(byte[] Buffer, String Password);
    int loadKeyFromBufferPKCS8(byte[] Buffer, int StartIndex, int Count, String Password);

Parameters

  • Buffer - the buffer from which the key is loaded.
  • Size - the size of the buffer from which the data is loaded.
  • Password - the pass phrase to decrypt the key. If the key is not encrypted, set this parameter to empty string.
  • StartIndex - index of the first byte of the key data in Buffer.
  • Count - number of bytes to be read from Buffer.

Return value

    Returns 0 if the key was successfully loaded, and an error code otherwise.

Description

    This method attempts to read the certificate's private key from the provided memory location of the given size. The key must have been saved in PKCS8 format.

Discuss this help topic in SecureBlackbox Forum