Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToBufferPEM

TElX509Certificate     See also     


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


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

Declaration

[C#]
    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)

[Java]
    boolean saveKeyToBufferPEM(byte[][] Buffer, String PassPhrase);
    boolean saveKeyToBufferPEM(byte[][] Buffer, int[] Size, int EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, String PassPhrase);
    boolean saveKeyToBufferPEM(byte[][] Buffer, int[] Size, String PassPhrase);
    boolean saveKeyToBufferPEM(byte[][] Buffer, int EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, String PassPhrase);
    boolean saveKeyToBufferPEM(byte[] Buffer, TSBInteger Size, String PassPhrase);
    boolean saveKeyToBufferPEM(byte[] Buffer, TSBInteger Size, int EncryptionAlgorithm, TSBSymmetricCryptoMode 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