Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.LoadFromStreamAuto

TElX509Certificate     See also     


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


Reads the certificate from the stream.

Declaration

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

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

[Pascal]
    function LoadFromStreamAuto(Stream : TStream; const Password : string; Count : integer) : integer;

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

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

Parameters

  • Stream - The stream from which the certificate 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 - Specifies the passphrase to decrypt the certificate data. If the certificate is not encrypted, set this parameter to an empty string.

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 from the stream. 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, SPC.

See also:     LoadFromBufferAuto     LoadFromFileAuto    

Discuss this help topic in SecureBlackbox Forum