Documentation for MemCryptStorage?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
rayrad
Posts: 5
Joined: Sat 27 Nov 2010 18:54
Location: Kirkland, WA

Documentation for MemCryptStorage?

Post by rayrad » Thu 28 Feb 2019 17:54

Problem
We have an Azure WebJob that needs to connect to a remote PostgreSQL database via encrypted connection. This job interacts with a customer's database so the connection string and SSL certificate files are dynamic and cannot be deployed with the service, either as a separate file or an embedded resource. The connection string not a problem, but the SslOptions class appears to only accept paths to files.

Searching the web and these forums, the 6.0 release from 2012 notes say:

"The MemCryptStorage class for storing SSL certificates in the application memory is implemented."

We tried using this and calling the AddCert and AddKey methods but it did not work. Searching the web, DevArt documentation, and DevArt forums, there is almost zero information on this class. This surprises me because loading keys and certs from memory seems like a reasonably common scenario.

Questions
  • Is there any official documentation on MemCryptStorage?
  • Both AddCert and AddKey require a "id" parameter. How is this parameter later used? Is there some id value that needs to be set on the connection or something to get it to find the stored credentials?
  • Is MemCryptStorage the correct way to accomplish our goal?
  • Is there any way to accomplish our goal with dotConnect for PostgreSQL?
Thank you very much in advance for any assistance.

Dave Parker

rayrad
Posts: 5
Joined: Sat 27 Nov 2010 18:54
Location: Kirkland, WA

Re: Documentation for MemCryptStorage?

Post by rayrad » Tue 12 Mar 2019 20:25

Wow. Nobody has any response to this? Is this feature still even supported? If not, what is the best way to load the cert and key files from an in-memory context?

Thanks,
Dave Parker

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Documentation for MemCryptStorage?

Post by Pinturiccio » Wed 13 Mar 2019 16:28

Sorry for the late response. We are processing your request and will contact you as soon as possible.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Documentation for MemCryptStorage?

Post by Pinturiccio » Thu 14 Mar 2019 15:14

Indeed we do not have any documentation regarding MemCryptStorage. We will add corresponding information to our documentation.

You can use the following code:

Code: Select all

MemCryptStorage.AddCert("my_test_cert", content)
where id is a string, and content is the content of a cert.pem file either as a string or as an array of bytes.

After this, you may use this certificate in your connection strings in the following way:

Code: Select all

Ssl Cert=memory://my_test_cert
where my_test_cert is the id text specified in the AddCert method.
rayrad wrote:Is MemCryptStorage the correct way to accomplish our goal?
Is there any way to accomplish our goal with dotConnect for PostgreSQL?
Yes, dotConnect for PostgreSQL and MemCryptStorage should accomplish your goal.

Post Reply