Discuss this help topic in SecureBlackbox Forum

TElCustomCertStorage.SaveToBufferPFX

TElCustomCertStorage     See also     


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


Use this method in derived classes to save certificates contained in storage to buffer in PFX (PKCS12) format.

Declaration

[C#]
    int SaveToBufferPFX(ref byte[] Buffer, ref int Size, string Password, int KeyEncryptionAlgorithm, int CertEncryptionAlgorithm);
    int SaveToBufferPFX(ref byte[] Buffer, int StartIndex, ref int Size, string Password);

[VB.NET]
    Function SaveToBufferPFX(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal Password As String, ByVal KeyEncryptionAlgorithm As Integer, ByVal CertEncryptionAlgorithm As Integer) As Integer
    Function SaveToBufferPFX(ByRef Buffer As Byte(), ByVal StartIndex As Integer, ByRef Size As Integer, ByVal Password As String) As Integer

[Pascal]
    function SaveToBufferPFX(Buffer : pointer; var Size : integer; Password : string; KeyEncryptionAlgorithm : integer; CertEncryptionAlgorithm : integer) : integer;
    function SaveToBufferPFX(Buffer : pointer; var Size : integer; Password : string) : integer;

[C++]
    int32_t SaveToBufferPFX(void * Buffer, int32_t &Size, const std::string &Password, int32_t KeyEncryptionAlgorithm, int32_t CertEncryptionAlgorithm);
    int32_t SaveToBufferPFX(void * Buffer, int32_t &Size, const std::string &Password);

[PHP]
    integer SaveToBufferPFX(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size, string $Password, integer $KeyEncryptionAlgorithm, integer $CertEncryptionAlgorithm)
    integer SaveToBufferPFX(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size, string $Password)

[Java]
    int saveToBufferPFX(byte[] Buffer, int StartIndex, TSBInteger Size, String Password);
    int saveToBufferPFX(byte[] Buffer, TSBInteger Size, String Password, int KeyEncryptionAlgorithm, int CertEncryptionAlgorithm);

Parameters

  • Buffer - Buffer with PKCS12 data
  • StartIndex - Index of the first byte in the Buffer from which to start saving.
  • Size - Size of Buffer in bytes
  • 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.

Values:

Return value

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

PKCS12 Error codes

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     SaveToStreamPFX    

Discuss this help topic in SecureBlackbox Forum