I need to use ECDSA with sha256 with a hsm and I am using c# with the http://www.pkcs11interop.net/ wrapper. The Github code has CKM_ECDSA_SHA256, but not the 3.3.0 release even though the release is the latest as of Jan 24 and the enum was added much earlier.
Why cannot I access the enum? I could use CKM_ECDSA and hash before signing, but that would defeat the purpose of using the hsm for its speed.
CKM_ECDSA_SHA256 enum member was added on 1 March 2017 as a part of larger patch that added support for PKCS#11 v2.40. It was not present in Pkcs11Interop v3.3.0 but it is present in master branch on GitHub which is yet to be released as Pkcs11Interop v4.0.0.
Meanwhile you can use overloaded method which accepts ulong instead of CKM and define missing constant in your code:
const ulong CKM_ECDSA_SHA256 = 0x00001044;