EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTPs Server - Load multiple Certificates from one PFX File

Posted: 03/11/2015 03:35:07
by ITSG (Standard support level)
Joined: 06/27/2013
Posts: 34

Hi there,

is it possible to load several (in my case 3) certificates from one PFX File in the CERT Storage ? I am using the TElX509Certificate in TElSimpleFTPSServer
Works fine with one CERT, but we now have 3 (Intermediate, root, etc.)
Any ideas ? This is my code:
using (certificateStream = new FileStream(certificatePath, FileMode.Open, FileAccess.Read))
                    if (certificateStream.Length > 0)
                        var cert = new TElX509Certificate();
                            if ((cert.LoadFromStreamAuto(certificateStream, certificatePassword, (int)certificateStream.Length) == 0) && (cert.PrivateKeyExists))
                        _ftpServer.CertStorage.Add(cert, true);                                
                        catch (Exception ex)
                            _loggingService.Error("FTPs: " + ex.Message, ex.Source, ex);

Thank You
Posted: 03/11/2015 03:36:47
by ITSG (Standard support level)
Joined: 06/27/2013
Posts: 34

BTW: I want to do it from one single PFX, because in our Software we can only specify one PFX as source...
Posted: 03/11/2015 03:40:14
by Ken Ivanov (Team)

Hi Martin,

Thank you for getting in touch with us.

Yes, you can load several certificates from one PFX file into a certificate storage. Please see the TElMemoryCertStorage.LoadFromStreamPFX() method.




Topic viewed 405 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!