My HSM has another role which is "Crypto User" with the limited crypto operation that can be performed (encrypt/decrypt/sign/verify).
So, I can't use the following code to log in as Crypto User but I'm not sure why it doesn't.
pkcs11Library = Settings.Factories.Pkcs11LibraryFactory.LoadPkcs11Library(Settings.Factories, Settings.Pkcs11LibraryPath, Settings.AppType);
slot = Helpers.GetUsableSlot(pkcs11Library);
session = slot.OpenSession(SessionType.ReadOnly);
Anyone please kindly help.
P.S. It has no problem with the "Crypto Officer" role. It can use the ReadWrite session and CKU_USER type to log in.