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

Add support for CryptographyContext factories #283

Merged
merged 2 commits into from
Mar 2, 2017

Conversation

dusk0r
Copy link
Contributor

@dusk0r dusk0r commented Mar 2, 2017

Currently there is no way to control the creation of (S/MIME / OpenPGP) CryptographyContexts. I propose optional factory methods.

@jstedfast
Copy link
Owner

Why not just subclass the context you want and register it's Type?

@jstedfast
Copy link
Owner

I much prefer the way it is now...

@jstedfast jstedfast closed this Mar 2, 2017
@dusk0r
Copy link
Contributor Author

dusk0r commented Mar 2, 2017

Because you can't use non-static external resources.

@jstedfast
Copy link
Owner

Can you give me an example of what you are trying to accomplish that can't be done by subclassing?

@jstedfast
Copy link
Owner

Keep in mind that your PR breaks existing users of MimeKit... :(

@jstedfast
Copy link
Owner

Actually, n/m, I looked at your PR again and it doesn't...

@dusk0r
Copy link
Contributor Author

dusk0r commented Mar 2, 2017

We have several ASP.NET webapps. On startup they fetch a private S/MIME Key to sign outgoing mails. I don't want to embed or store the certificate on the machine.

Right now my best solution is to fetch the key and store it into a static property. Then subclass the context and load the key from that property. But I don't like that solution.

@jstedfast
Copy link
Owner

Since it doesn't break API/ABI, I'm willing to merge this, but can you fix the code formatting/indenting to match the rest of the code? Thanks.

@jstedfast jstedfast reopened this Mar 2, 2017
@jstedfast
Copy link
Owner

Awesome, thank you.

@jstedfast jstedfast merged commit 0f8a713 into jstedfast:master Mar 2, 2017
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

2 participants