Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToBufferPEM

TElX509Certificate     See also     


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


Saves the private key of the certificate to the memory buffer in PEM format.

Declaration

[C#/Java]
    bool SaveKeyToBufferPEM(out byte[] Buffer, string PassPhrase);
    bool SaveKeyToBufferPEM(ref byte[] Buffer, ref int Size, string PassPhrase);
    bool SaveKeyToBufferPEM(ref byte[] Buffer, int EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, string PassPhrase);
    bool SaveKeyToBufferPEM(ref byte[] Buffer, ref int Size, int EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, string PassPhrase);

[VB.NET]
    Function SaveKeyToBufferPEM(Out Buffer As Byte(), ByVal PassPhrase As String) As Boolean
    Function SaveKeyToBufferPEM(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal PassPhrase As String) As Boolean
    Function SaveKeyToBufferPEM(ByRef Buffer As Byte(), ByVal EncryptionAlgorithm As Integer, ByVal EncryptionMode As TSBSymmetricCryptoMode, ByVal PassPhrase As String) As Boolean
    Function SaveKeyToBufferPEM(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal EncryptionAlgorithm As Integer, ByVal EncryptionMode As TSBSymmetricCryptoMode, ByVal PassPhrase As String) As Boolean

[Pascal]
    function SaveKeyToBufferPEM(Buffer: Pointer; var Size: integer; PassPhrase : string) : boolean;

[C++]
    bool SaveKeyToBufferPEM(void * Buffer, int32_t &Size, const std::string &PassPhrase);
    bool SaveKeyToBufferPEM(void * Buffer, int32_t &Size, int32_t EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, const std::string &PassPhrase);

[PHP]
    bool SaveKeyToBufferPEM(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size, string $PassPhrase)
    bool SaveKeyToBufferPEM(TSBPointer|array of byte|string|NULL $Buffer, integer &$Size, integer $EncryptionAlgorithm, integer $EncryptionMode, string $PassPhrase)

Parameters

  • Buffer - the buffer to which the private key is saved.
  • Size - the size of the buffer to which the private key 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.
  • PassPhrase - the pass phrase to encrypt the private key.
  • EncryptionAlgorithm - ...
  • EncryptionMode - ...

TSBSymmetricCryptoMode values

Return value

    True on success.
    False if the buffer size is too small. In this case this method sets Size parameter is set to the size which will be enough to hold the whole data.

Description

    This method saves the private key 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.

Discuss this help topic in SecureBlackbox Forum