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

Private key of the certificate are not encrypted #225

Open
FieryPhoenix100 opened this issue Jan 17, 2022 · 3 comments
Open

Private key of the certificate are not encrypted #225

FieryPhoenix100 opened this issue Jan 17, 2022 · 3 comments

Comments

@FieryPhoenix100
Copy link

When creating certificates via DirectoryStore, it is not possible to encrypt the private key of the certificate. There is also no way to read the encrypted private key.

@quinmars
Copy link
Contributor

May I ask what you are trying to accomplish? The DirectoryStore can be used by the channel to retrieve the local certificate and the corresponding key parameters. Usually, you do not have to call the DirectoryStore methods yourself. There are cases were you might want to implement IDirectoryStore, for example when you want to add some user interface interactions. But even there I'd make it a wrapper around the existing DirectoryStore.

@FieryPhoenix100
Copy link
Author

I would like to be able to store private keys in encrypted form. I see that the keys are written to a file using PemWriter. PemWriter can encrypt keys. Unfortunately this feature is not available when using DirectoryStore. I think it's not safe to store private keys unencrypted.

@awcullen
Copy link
Contributor

awcullen commented Feb 5, 2022

I believe the suggestion is to add algorithm and password arguments (strings) to the DirectoryStore constructor (or have reasonable defaults). Then use these parameters when reading and writing the private key files (pem encoded).

Anyone wish to contribute?

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

No branches or pull requests

3 participants