EldoS
Navigation
Web site
Support
Table Of Contents

Filter: C#  VB.NET  Pascal  ActiveX  DLL 


TElX509Certificate.LoadFromStreamPFX

TElX509Certificate     See also    


 

Reads the certificate from the stream. Certificate is contained in PFX format.

 
 

Declaration

[C#]
     int LoadFromStreamPFX(System.IO.Stream Stream, [in] string Password, int Count /* = 0 */);

[VB.NET]
    Function LoadFromStreamPFX(ByVal Stream As Stream, ByVal Password As String, ByVal Count As Integer = 0) As Integer

[Pascal]
    function LoadFromStreamPFX(Stream : TStream; Password : string; Count : integer = 0) : integer;

[VB6]
    not implemented

[ActiveX]
    not implemented

[DLL]
    not applicable;
 
 

Parameters

  • Stream - The stream from which the certificate is loaded.
  • Count - Optional parameter that specified the number of bytes to be read. If this parameter is zero, the whole stream (from current position till the end) is read.
  • Password - Specifies the passphrase to decrypt the certificate data. If the certificate is not encrypted, set this parameter to an empty string.
 
 

Return value

    0 on success.
    PKCS12 error code otherwise.

 
 

PKCS12 Error Codes

[.NET] [Pascal] [ActiveX] [DLL] Value Description
SB_PKCS12_ERROR_INVALID_ASN_DATA 793 (0x1F01) Buffer doesn't contain a valid PFX sequence
SB_PKCS12_ERROR_NO_DATA 7938 (0x1F02) The PFX message doesn't contain any certificate
SB_PKCS12_ERROR_INVALID_DATA 7939 (0x1F03) Some parameters of PFX message are invalid
SB_PKCS12_ERROR_INVALID_VERSION 7940 (0x1F04) PFX message version is invalid
SB_PKCS12_ERROR_INVALID_CONTENT 7941 (0x1F05) PFX message contains invalid content
SB_PKCS12_ERROR_INVALID_AUTHENTICATED_SAFE_DATA 7942 (0x1F06) AuthenticatedSafe part of PFX message is invalid
SB_PKCS12_ERROR_INVALID_MAC_DATA 7943 (0x1F07) MAC part of PFX message PFX message is invalid
SB_PKCS12_ERROR_INVALID_SAFE_CONTENTS 7944 (0x1F08) The entity located in PFX message has invalid content type.
SB_PKCS12_ERROR_INVALID_SAFE_BAG 7945 (0x1F09) The entity located in PFX message has invalid format
SB_PKCS12_ERROR_INVALID_SHROUDED_KEY_BAG 7946 (0x1F0A) The private key contained in PFX message has invalid format
SB_PKCS12_ERROR_UNKNOWN_PBE_ALGORITHM 7947 (0x1F0B)
  • Saving: invalid PBE algorithm specified
  • Loading: unknown PBE algorithm was used to encrypt the message.
  • SB_PKCS12_ERROR_INTERNAL_ERROR 7948 (0x1F0C) Internal error occured. Please contact EldoS support for details.
    SB_PKCS12_ERROR_INVALID_PBE_ALGORITHM_PARAMS 7949 (0x1F0D) PBE algorithm params (iteration count and salt) are invalid
    SB_PKCS12_ERROR_INVALID_CERT_BAG 7950 (0x1F0E) The certificate contained in PFX message has invalid format
    SB_PKCS12_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 7951 (0x1F0F) The certificate contained in PFX message has unsupported type
    SB_PKCS12_ERROR_INVALID_PRIVATE_KEY 7952 (0x1F10) The private key contained in PFX message has invalid format
    SB_PKCS12_ERROR_INVALID_MAC 7953 (0x1F11) MAC verification failed
    SB_PKCS12_ERROR_NO_CERTIFICATES 7954 (0x1F12) Saving: nothing to save
    SB_PKCS12_ERROR_INVALID_PASSWORD 7955 (0x1F13) Invalid password was specified. Can not decrypt certificate.
    SB_PKCS12_ERROR_BUFFER_TOO_SMALL 7956 (0x1F14) Buffer doesn't have enough space to store encoded certificate
    Declared in
    [.NET] [Pascal]
    Namespace: SBPKCS12
    Assembly: SecureBlackbox
    Unit: SBPKCS12

     
     

    Description

        Use this method to read the certificate from the stream. The read operation is started at current stream position and finished when the end of the stream is reached or when the number of bytes specified in Count parameter is read. The certificate must have been saved in PFX format.

     
     

    See also:     LoadFromStreamAuto     LoadFromStream     LoadFromBufferPFX     SaveToStreamPFX    

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