Discuss this help topic in SecureBlackbox Forum

TElCertificateRequest.SaveKeyToBufferPEM

TElCertificateRequest     See also     


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


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

Declaration

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

[VB.NET]
    Function SaveKeyToBufferPEM(Out Buffer As Byte(), ByVal Passphrase As String) As Boolean
    Function SaveKeyToBufferPEM(Out 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 Passphrase As String) As Boolean
    Function SaveKeyToBufferPEM(ByRef Buffer As Byte(), ByVal EncryptionAlgorithm As Integer, ByVal EncryptionMode As TSBSymmetricCryptoMode, ByRef Size As Integer, ByVal Passphrase As String) As Boolean

[Pascal]
    function SaveKeyToBufferPEM(Buffer: pointer; var Size: integer; const Passphrase: string) : boolean;

[C++]
    bool SaveKeyToBufferPEM(void * Buffer, int32_t &Size, const std::string &Passphrase);
    bool SaveKeyToBufferPEM(void * Buffer, int32_t EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, int32_t &Size, 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 $EncryptionAlgorithm, integer $EncryptionMode, integer &$Size, string $Passphrase)

[Java]
    boolean saveKeyToBufferPEM(byte[][] Buffer, String Passphrase);
    boolean saveKeyToBufferPEM(byte[][] Buffer, int EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, String Passphrase);
    boolean saveKeyToBufferPEM(byte[] Buffer, TSBInteger Size, String Passphrase);
    boolean saveKeyToBufferPEM(byte[] Buffer, int EncryptionAlgorithm, TSBSymmetricCryptoMode EncryptionMode, TSBInteger Size, 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. If the key shouldn't be encrypted, set this parameter to empty string
  • 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 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. The private key is saved in PEM format.

See also:     SaveKeyToBuffer     SaveKeyToStreamPEM    

Discuss this help topic in SecureBlackbox Forum