Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.LoadKeyFromBufferAuto

TElX509Certificate     See also     


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


Loads the certificate's private key from the memory buffer.

Declaration

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

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

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

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

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

[Java]
    int loadKeyFromBufferAuto(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 password to decrypt the private key. If the key is not encrypted, set this parameter to empty string
  • StartIndex - position in the Buffer from which the data must be read
  • Count - amount of bytes to be read from start position

Return value

    0 on success.
    Error code otherwise.
    If the format of the certificate is not recognized, SB_X509_ERROR_UNRECOGNIZED_FORMAT (0x5009) error is reported.

Description

    This method attempts to read the certificate's private key from the provided memory location of the given size. It recognizes the format automatically; if the format is not recognized, SB_X509_ERROR_UNRECOGNIZED_FORMAT (0x5009) error is reported. The supported formats are: DER, PEM, PFX, PVK, NET, PKCS#8.

See also:     LoadKeyFromFileAuto     LoadKeyFromStreamAuto    

Discuss this help topic in SecureBlackbox Forum