Hello,
Using UniDAC 7.0.2. Database system is PostgreSQL 9.6.3. Connection will be over an SSL (certificate files will be used).
One of my projects require me to use a single EXE file. I need to also save certificate files as a Resource in that same EXE. For customer security reasons, My application cannot create any temporary files on the file system at run-time.
What I need to do is save certificate files encrypted in EXE as a resource. Read and decrypt these certificate files in TMemoryStream or similar and use them without saving them on file system.
Is there any way to accomplish such a task with TUniConnection?
Thanks & regards,
Ertan
TUniConnection.SpecificParameters
Re: TUniConnection.SpecificParameters
You can implement the required functionality by yourself. For this, you can use the following recommendations :
- use Unidac with the Securebridge components. SecureBridge allows to establish secure connections within a single application without any external files. You can get information about the connection to the PostgreSQL server, using SSL, in our documentation: https://www.devart.com/pgdac/docs/?secu ... ctions.htm;
- to create and further work with the certificate, you should use the ScMemoryStorage component;
- import certificates in runtime using the TScCertificate.ImportFrom (Stream: TStream) method.
- use Unidac with the Securebridge components. SecureBridge allows to establish secure connections within a single application without any external files. You can get information about the connection to the PostgreSQL server, using SSL, in our documentation: https://www.devart.com/pgdac/docs/?secu ... ctions.htm;
- to create and further work with the certificate, you should use the ScMemoryStorage component;
- import certificates in runtime using the TScCertificate.ImportFrom (Stream: TStream) method.
Code: Select all
var
Cert: TScCertificate;
MyCert: String;
SStream: TStringStream;
...
Cert := TScCertificate.Create(ScRegStorage.Certificates);
Cert.Name := 'CertName'
SStream:=TStringStream.Create(MyCert);
Cert.ImportFrom(SStream);