Discuss this help topic in SecureBlackbox Forum

TElCustomCertStorage.SaveToStreamPFX

TElCustomCertStorage     See also     


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


Saves the certificates contained in the storage to the stream in PFX (PKCS12) 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; const Password: string; KeyEncryptionAlgorithm: integer; CertEncryptionAlgorithm: integer): integer;
    function SaveToStreamPFX(Stream: TStream; const 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 certificates are written.
  • Password - Password to encrypt certificates
  • KeyEncryptionAlgorithm - Password-based (PBE) algorithm which should be used to encrypt private keys. If this parameter is omitted, the default algorithm is SB_ALGORITHM_PBE_SHA1_3DES.
  • CertEncryptionAlgorithm - Password-based (PBE) algorithm which should be used to encrypt certificates. If this parameter is omitted, the default algorithm is SB_ALGORITHM_PBE_SHA1_RC2_40.

Return value

    0 if certificates were successfully saved.
    PKCS12 error code otherwise.

Values:


Description

    Use this method in derived classes to save currently stored certificates in PFX format. PFX format supports storing of private keys.

See also:     LoadFromBufferPFX     LoadFromStreamPFX     SaveToBufferPFX    

Discuss this help topic in SecureBlackbox Forum