Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveToStreamPFX

TElX509Certificate     See also     


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


Writes the certificate to the stream in PFX format.

Declaration

[C#/Java]
    int SaveToStreamPFX(System.IO.Stream Stream, string Password, int KeyEncryptionAlgorithm, int CertEncryptionAlgorithm);
    int SaveToStreamPFX(System.IO.Stream Stream, string Password);

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

[Pascal]
    function SaveToStreamPFX(Stream : TStream; Password : string; KeyEncryptionAlgorithm: integer; CertEncryptionAlgorithm: integer) : integer;
    function SaveToStreamPFX(Stream : TStream; Password : string) : integer;

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

[PHP]
    integer SaveToStreamPFX(TStream $Stream, string $Password, integer $KeyEncryptionAlgorithm, integer $CertEncryptionAlgorithm)
    integer SaveToStreamPFX(TStream $Stream, string $Password)

Parameters

  • Stream - The stream to which the certificate is written.
  • Password - The pass phrase to encrypt the certificate. If certificate shouldn't be encrypted, set this parameter to empty string
  • KeyEncryptionAlgorithm - the PBE (password-based) algorithm which should be used to encrypt private key. See values below. If this parameter is omitted, the default algorithm is SB_ALGORITHM_PBE_SHA1_3DES.
  • CertEncryptionAlgorithm - the PBE (password-based) algorithm which should be used to encrypt certificate. See values below. If this parameter is omitted, the default algorithm is SB_ALGORITHM_PBE_SHA1_RC2_40.

Values:


Return value

    0 on success.
    PKCS12 error code otherwise.

Description

    Use this method to write the certificate to stream. The certificate is saved in PFX format.

See also:     LoadFromStreamPFX     SaveToStream    

Discuss this help topic in SecureBlackbox Forum