Open oliviervibe opened 2 years ago
The PKCS11::LowLevel class is still accessible, but I can't find a way to initialize it with an instantiated PKCS11::FunctionListPtr.
Is there a way to create a bridge between the High-level API and the low-level API as I can't understand that it couldn't be possible to create and use AES Keys in a PKCS11 token with Botan.
I finally found it!!
It would be nice to document that the access to the PKCS11::LowLevel API class is done through the -> operator overload... I was looking for a getLowLevel() function ;-), of course the operator overload is more elegant!
Thanks
I have the following code in C to generate an AES Key object for a PKCS11 token:
CK_RV generateAESKey(CK_SESSION_HANDLE hSession, const char tokenLabel, CK_MECHANISM_TYPE ckMechType, const char keyLabel, CK_ULONG keyLen, CK_BBOOL token, CK_BBOOL extractable, CK_OBJECT_HANDLE_PTR phAesKey) { // Generate a Secret Key for AES (16 or 32 bytes) CK_MECHANISM ckMechanism; ckMechanism.mechanism = CKM_AES_KEY_GEN; ckMechanism.pParameter = NULL; ckMechanism.ulParameterLen = 0;
}
I have used Botan to wrap the code for the PKCS11 library of an HSM and I already implemented all the authentication mechanisms I needed with the Public Key high-level API of Botan.
I can't find any high-level implementation to generate an AES key. Since the last version, the low-level API is no longer accessible as the includes are not public!
Do I miss something as I can't find anything to do that in the documentation, nor in the high-level API. There should be high-level access to C_GenerateKey but I can't find it.
If there is no high-level access, how can I use the low-level wrapper for PKCS now??
Thanks for your help.