Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToStreamNET

TElX509Certificate     See also     


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


Saves the private key of the certificate to the stream in NET format.

Declaration

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

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

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

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

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

[Java]
    int saveKeyToStreamNET(OutputStream Stream, String Password);
    int saveKeyToStreamNET(TElStream Stream, String Password);

Parameters

  • Stream - object to which the private key is saved
  • Password - the password to encrypt the key. If the key shouldn't be encrypted, set this parameter to empty string

Return value

    0 - if the key was successfully saved.
    Otherwise PKCS#8 error code.

Description

    This method saves the private key to the provided stream. The private key will be saved in NET format. NET format was invented by Microsoft Corp. and is based on PKCS#8 private key format. However, it is not fully compatible with PKCS#8, so passing a buffer with raw PKCS#8 data will cause an 'invalid format' error.

Discuss this help topic in SecureBlackbox Forum