EldoS
Navigation
Web site
Support
Table Of Contents

Filter: C#  VB.NET  Pascal  ActiveX  DLL 


TElX509Certificate.SaveKeyToBufferPVK

TElX509Certificate     See also    


 

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

 
 

Declaration

[C#]
    int SaveKeyToBufferPVK(out byte[] Buffer, string Password, bool UseStrongEncryption /* = true */);
    int SaveKeyToBufferPVK(ref byte[] Buffer, ref int Size, [in] string Password, bool UseStrongEncryption /* = true */);

[VB.NET]
    Function SaveKeyToBufferPVK(ByRef Buffer As Byte(), ByVal Password As String, UseStrongEncryption As Boolean = True) As Integer
    Function SaveKeyToBufferPVK(ByRef Buffer As Byte(), ByRef Size As Integer, ByVal Password As String, UseStrongEncryption As Boolean = True) As Integer

[Pascal]
    function SaveKeyToBufferPVK(Buffer: pointer; var Size : integer; const Password : string; UseStrongEncryption: boolean = true) : integer;

[VB6]
    Sub IElCertificateX6.SaveKeyToBufferPVK(Password As String, UseStrongEncryption As Boolean, Buf As Variant)

[ActiveX]
    HRESULT _stdcall IElCertificateX6.SaveKeyToBufferPVK([in] BSTR Password, VARIANT_BOOL UseStrongEncryption, [out] VARIANT * Buf);

[DLL]
    not implemented;
 
 

Parameters

  • Buffer (Buf) - 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. If the key shouldn't be encrypted, set this parameter to empty string
  • UseStrongEncryption - determines the key length. If True the 128-bits key is used.
    False - 40-bits key.
    Default value is True
 
 

Return value

    0 - if the key was successfully saved.
    Otherwise PVK error code.

 

PVK Error Codes

[.NET] [Pascal] Value Description
SB_X509_ERROR_INVALID_PVK_FILE 20481 (0x5001) Buffer doesn't contain a valid PVK sequence
SB_X509_ERROR_INVALID_PASSWORD 20482 (0x5002) A non-valid password was specified
SB_X509_ERROR_NO_PRIVATE_KEY 20483 (0x5003) Attempt to save private key when it is absent.
SB_X509_ERROR_UNSUPPORTED_ALGORITHM 20484 (0x5004) Attempt to save a key for the algorithm that is not supported by PVK.
SB_X509_ERROR_INVALID_PRIVATE_KEY 20485 (0x5005) The private key has invalid format.
SB_X509_ERROR_INTERNAL_ERROR 20486 (0x5006) Internal error occured. Please contact EldoS support for details.
SB_X509_ERROR_BUFFER_TOO_SMALL 20487 (0x5007) Buffer doesn't have enough space to store encoded certificate
SB_X509_ERROR_NO_CERTIFICATE 20488 (0x5008) Buffer doesn't contain a certificate
Declared in
[.NET] [Pascal]
Namespace: SBX509
Assembly: SecureBlackbox
Unit: SBX509

 
 

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 will be saved in PVK (Microsoft secret) format.

 
 

See also:     LoadKeyFromBufferPVK     LoadKeyFromStreamPVK     SaveKeyToStreamPVK     SaveKeyToBuffer     SaveKeyToBufferMS     SaveKeyToBufferNET     SaveKeyToBufferPEM    

 
Contact Us | Terms of Use | Trademarks | Privacy Statement
Copyright (c) 1998-2012, EldoS Corporation