EldoS
Navigation
Web site
Support
Table Of Contents

Filter: C#  VB.NET  Pascal  ActiveX  DLL 


TElX509Certificate.SaveKeyToStreamPVK

TElX509Certificate     See also    


 

Saves the private key of the certificate to the stream in PVK format.

 
 

Declaration

[C#]
    int SaveKeyToStreamPVK(System.IO.Stream Stream, [in] string PassPhrase, bool UseStrongEncryption /* = true */);

[VB.NET]
    Function SaveKeyToStreamPVK(ByVal Stream As System.IO.Stream, ByVal PassPhrase As String, UseStrongEncryption As Boolean = True) As Integer

[Pascal]
    function SaveKeyToStreamPVK(Stream : TStream; const Password : string; UseStrongEncryption: boolean = true) : integer;

[VB6]
    not implemented;

[ActiveX]
    not implemented;

[DLL]
    not applicable;
 
 

Parameters

  • Stream - the TStream (in Pascal case) or IStream (in ActiveX case) object to which the private key is saved
  • Password - the password to encrypt the 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 stream. The private key will be saved in PVK (Microsoft secret) format.

 
 

See also:     LoadKeyFromBufferPVK     LoadKeyFromStreamPVK     SaveKeyToBufferPVK     SaveKeyToStream     SaveKeyToStreamMS     SaveKeyToStreamNET     SaveKeyToStreamPEM    

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