Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.LoadKeyFromStreamPVK

TElX509Certificate     See also     


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


Reads the certificate's private key from the stream. The key should be contained in PVK format.

Declaration

[C#]
    int LoadKeyFromStreamPVK(System.IO.Stream Stream, string Password, int Count);

[VB.NET]
    Function LoadKeyFromStreamPVK(ByVal Stream As System.IO.Stream, ByVal Password As String, ByVal Count As Integer) As Integer

[Pascal]
    function LoadKeyFromStreamPVK(Stream : TStream; const Password : string; Count : integer = 0) : integer;

[C++]
    int32_t LoadKeyFromStreamPVK(TStream &Stream, const std::string &Password, int32_t Count);
    int32_t LoadKeyFromStreamPVK(TStream *Stream, const std::string &Password, int32_t Count);

[PHP]
    integer LoadKeyFromStreamPVK(TStream $Stream, string $Password, integer $Count)

[Java]
    int loadKeyFromStreamPVK(TElStream Stream, String Password, int Count);
    int loadKeyFromStreamPVK(InputStream Stream, String Password, int Count);

Parameters

  • Stream - The stream from which the private key is loaded.
  • Count - Optional parameter that specified the number of bytes to be read. If this parameter is zero, the whole stream (from current position till the end) is read.
  • Password - The password to decrypt the private key. If the key is not encrypted, set this parameter to empty string

Return value

    0 on success.
    PVK error code otherwise.

Description

    Use this method to read the certificate's private key from the stream. The read operation is started at current stream position and finished when the end of the stream reached or when the number of bytes specified in Count parameter is read. The private key must have been saved in PVK (Microsoft secret) format.

Discuss this help topic in SecureBlackbox Forum