Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Ability to encrypt variables with RSA Certificate. #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

erothFEI
Copy link

Was curious to see if this feature was a viable option to consider adding?

We do this type of thing manually right now with variables that store the encrypted text and it is a pain when updating certificates.

I can flush out the .Net Framework 4.5.2 tests plus additional test cases if needed.

try
{

var certificate = new X509Certificate2(Convert.FromBase64String(arguments[0]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The certificate is not disposed. Also we should think what key set to use and which store. Ephemeral seems to be a good choice in this, but I'm not sure of that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the Ephemeral key store is not natively availabe in .Net Standard 1.3 or .Net Framework 4.0. It seems to work if I use:new X509Certificate2(Convert.FromBase64String(arguments[0]), (string)null, (X509KeyStorageFlags)32) but I am not confident it would work on a machine that does not have a later version of .Net installed.

{
}

return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be inside the catch statement

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just using the FormatFunction as an example for this. Would it be preferable for me to just allow the exception to bubble up?

@CLAassistant
Copy link

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants