Task #4075
closedKeyHandleOsx could be simplified
100%
Description
Just an observation. The implementations of BackEndOsx::sign
, decrypt
and derivePublicKey
don't use m_impl
, so they can be static.
https://github.com/named-data/ndn-cxx/blob/fe4733a1608712e389fe10b329a9fd61575ad075/src/security/tpm/back-end-osx.hpp#L83
This means that KeyHandleOsx::doSign
, doDecrypt
and doDerivePublicKey
can call the static methods BackEndOsx::sign
, etc. and don't need the m_impl
in KeyHandleOsx
. For example,
return BackEndOsx::sign(m_key, digestAlgorithm, buf, size);
Finally, you could remove m_impl
from KeyHandleOsx
, and the constructor can be simplified to omit the impl
parameter.
https://github.com/named-data/ndn-cxx/blob/0b60e7a9aaecc0e769d430c9484e4c8f3c778716/src/security/tpm/key-handle-osx.hpp#L55
It's up to you. If you don't want this simplification, feel free to abandon this issue.