-
Notifications
You must be signed in to change notification settings - Fork 76
Description
MechanismWithParam
was a hack to allow for various param mechanisms, but it doesn't scale.
mechanism_param
should be removed and mechanism
be replaced to allow either a CK_MECHANISM
or a Mechanism
class.
The default Mechanism class would be mechanism=Mechanism(CK_MECHANISM, param=...)
passing mechanism=CK_MECHANISM
would be equivalent to mechanism=Mechanism(CK_MECHANISM)
.
The Mechanism
class could be inherited to provide for specific, typed mechanisms Mechanism.RSA_PKCS_PSS(params...)
these would be responsible for allocating their appropriate structure in PKCS#11 and passing it as the mechanism parameter.
This is both more Pythonic, typeable (when typing is added to python-pkcs11) and allows for extension into more mechanism types, including extension outside of python-pkcs11.
See the discussion in #97 (comment) for more information.