Discuss this help topic in SecureBlackbox Forum

TElX509Certificate.SaveKeyToBufferPKCS8

TElX509Certificate     See also     


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


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

Declaration

[C#]
    int SaveKeyToBufferPKCS8(out byte[] Buffer, string Password);
    int SaveKeyToBufferPKCS8(ref byte[] Buffer, ref int Size, string Password);

[VB.NET]
    Function SaveKeyToBufferPKCS8(Out Buffer As Byte(), ByVal Password As String) As Integer
    Function SaveKeyToBufferPKCS8(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal Password As String) As Integer

[Pascal]
    function SaveKeyToBufferPKCS8(Buffer: pointer; var Size: integer; const Password: string): integer;

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

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

[Java]
    int saveKeyToBufferPKCS8(byte[] Buffer, TSBInteger Size, String Password);
    int saveKeyToBufferPKCS8(byte[][] Buffer, String Password);
    int saveKeyToBufferPKCS8(byte[][] Buffer, int[] Size, String Password);

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.
  • Password - the password to encrypt the private key.

Return value

    Returns the number of bytes written to the buffer on success, and -1 on failure. If Buffer is too small, the method sets Size to the number of bytes necessary to hold the key data.

Description

    This method saves the private key to the provided memory location of the given size. If the buffer is too small, the method sets Size to the number of bytes necessary to hold the key data.

Discuss this help topic in SecureBlackbox Forum