EldoS
Navigation
Web site
Support
Table Of Contents

Filter: C#  VB.NET  Pascal  ActiveX  DLL 


TElX509Certificate.SaveKeyToBufferMS

TElX509Certificate     See also    


 

Saves the private key of the certificate to the memory buffer in form compatible with CryptoAPI PRIVATEKEYBLOB format.

 
 

Declaration

[C#]
    int SaveKeyToBufferMS(ref byte[] Buffer, ref int Size);

[VB.NET]
    Function SaveKeyToBufferMS(ByRef Buffer As Byte(), ByRef Size As Integer) As Integer

[Pascal]
    function SaveKeyToBufferMS(Buffer: Pointer; var Size: Integer) : integer;

[VB6]
    Sub IElCertificateX6.SaveKeyToBufferMS(Buf As Variant)

[ActiveX]
    HRESULT _stdcall IElCertificateX6.SaveKeyToBufferMS([out] VARIANT * Buf);

[DLL]
    not applicable;
 
 

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.
 
 

Return value

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

 

MS Error Codes

[Pascal] Value Description
SB_MSKEYBLOB_ERROR_UNSUPPORTED_BLOB_TYPE 8449 (0x2101) Format has type that is not supported. Supported types are PRIVATEKEYBLOB and PUBLICKEYBLOB
SB_MSKEYBLOB_ERROR_INVALID_FORMAT 8450 (0x2102) Buffer doesn't contain valid MS key blob sequence.
SB_MSKEYBLOB_ERROR_UNSUPPORTED_VERSION 8451 (0x2103) Key version is not supported.
SB_MSKEYBLOB_ERROR_BUFFER_TOO_SMALL 8452 (0x2104) The buffer is too small.
SB_MSKEYBLOB_ERROR_NO_PRIVATE_KEY 8453 (0x2105) There is no private key but attempt to save it was made.
SB_MSKEYBLOB_ERROR_UNSUPPORTED_ALGORITHM 8454 (0x2106) Key contains unsupported algorithm or certificate algorithm is DH (Diffie-Hellman).
Declared in
[.NET] [Pascal]
Namespace: SBMSKeyBlob
Assembly: SecureBlackbox
Unit: SBMSKeyBlob

 
 

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.

 
 

See also:     LoadKeyFromBufferMS     LoadKeyFromStreamMS     SaveKeyToStreamMS     SaveKeyToBuffer     SaveKeyToBufferNET     SaveKeyToBufferPEM     SaveKeyToBufferPVK    

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