-
Notifications
You must be signed in to change notification settings - Fork 30
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
Use Builder Pattern for HsmKeyParams #155
Conversation
src/mococrw/hsm.h
Outdated
public: | ||
class Builder; | ||
|
||
bool isExtractable() const { return cka_extractable; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to expose PKCS#11 slang here? Wouldn't it be better if this provides some Abstraction and we say here that the param is that the is is extractable or not? Sensitive is really not self-explanatory.
src/hsm.cpp
Outdated
@@ -233,7 +234,8 @@ openssl::SSL_EVP_PKEY_Ptr HsmEngine::generateKey(const ECCSpec &spec, | |||
const std::string &keyLabel, | |||
const std::vector<uint8_t> &keyID) | |||
{ | |||
HsmKeyParams hsmKeyParams; | |||
HsmKeyParams hsmKeyParams = | |||
HsmKeyParams::Builder().setCkaExtractable(false).setCkaSensitive(true).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Most of the library uses {} for object construction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks cleaner to me now. Feel free to merge after the consistency problem has been fixed.
Merging in PR #156 |
Adapt the HsmKeyParams to use a Builder Pattern instead of a struct