jeudi 29 décembre 2016

Programmatically creating a dummy certificate with private key for testing

I have a C# unit test project where I'd like to test some encryption extensions that I've written. I would like to use a dummy cert for testing, but I have the following restrictions:

  • The build and test runs are done remotely on a machine that I do not have access to. Thus, I cannot install the certificate on the build machine.
  • I cannot include secrets (such as a .pfx file) as part of the git repository or build, as doing so would violate security protocols. Thus, I cannot read the cert from a file included in the project.

Since I'll be doing encryption and decryption, I need to have the private key information. How can I create this cert programmatically within these restraints?

Aucun commentaire:

Enregistrer un commentaire