TUniConnection.SpecificParameters

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ertank
Posts: 172
Joined: Wed 13 Jan 2016 16:00

TUniConnection.SpecificParameters

Post by ertank » Thu 06 Jul 2017 11:00

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

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TUniConnection.SpecificParameters

Post by ViktorV » Thu 06 Jul 2017 13:37

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.

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);

Post Reply