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

Support loading identities from key/cert files #31

Merged
merged 1 commit into from
Jun 24, 2017

Conversation

sfackler
Copy link
Collaborator

let cert = CertContext::new(cert).unwrap();

let mut options = AcquireOptions::new();
options.container("schannel-test");
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand CryptAcquireContext correctly, if you don't use CRYPT_VERIFYCONTEXT, the key is stored permanently on disk, is that right?

Copy link
Owner

@steffengy steffengy Jun 23, 2017

Choose a reason for hiding this comment

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

MSDN/CryptAcquireContext:

Instead, either prevent key storage by passing the CRYPT_VERIFYCONTEXT flag in the dwFlags parameter, or use an application-specific container that is unlikely to be used by another application. [...] For performance reasons, we recommend that you set the pszContainer parameter to NULL and the dwFlags parameter to CRYPT_VERIFYCONTEXT in all situations where you do not require a persisted key.

That sounds to me like we want verify_context() here.

@sfackler
Copy link
Collaborator Author

sfackler commented Jun 23, 2017 via email

Copy link
Owner

@steffengy steffengy left a comment

Choose a reason for hiding this comment

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

Oh right.
Other than that I generally don't like type_ (aesthetically),
which we unfortunately need, LGTM.

@sfackler sfackler merged commit d475251 into steffengy:master Jun 24, 2017
@sfackler sfackler deleted the key-import branch June 24, 2017 03:11
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.

3 participants