What am I doing wrong?
Thanks!
Two possibilities come to my mind:
Only session objects can be created during a read-only session
Therefore the session of C_CreateObject
needs to have been opened with the flags
argument set to CKF_SERIAL_SESSION | CKF_RW_SESSION
CKF_SERIAL_SESSION | CKF_RW_SESSION
.
pTemplate
argment to C_CreateObject
needs to include the CKA_TOKEN
attribute so that the newly created key would be a "token object" rather than a "session object". In PKCS#11, a token object is persistent across sessions whereas a session object is ephemeral and would get dropped once the session is closed.
Hope this helps.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.