Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveToBufferPFX

TElX509Certificate     See also     


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


Saves the certificate to the memory buffer in PFX format.

Declaration

[C#/Java]
    int SaveToBufferPFX(out byte[] Buffer, string Password, int KeyEncryptionAlgorithm, int CertEncryptionAlgorithm);
    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(Out Buffer As Byte(), ByVal Password As String, ByVal KeyEncryptionAlgorithm As Integer, ByVal CertEncryptionAlgorithm As Integer) As Integer
    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)

Parameters

  • Buffer - the buffer to which the certificate is saved.
  • StartIndex - Index of the first byte in the Buffer from which to start saving.
  • Size - the size of the buffer to which the data is saved. When the method returns, Size parameter contains the size of the data that were saved, or, if the buffer was too small, the size of the buffer enough to hold the data.
  • Password - the password to encrypt the certificate.
  • 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

    This method saves the certificate to the provided memory location of the given size. If the buffer is too small (or empty), Size parameter is set to the size which will be enough to hold the whole data. The certificate is saved in PFX format.

See also:     LoadFromBuffer     SaveToStreamPFX    

Discuss this help topic in SecureBlackbox Forum