DANH MỤC LỖI PKCS#11

Mã trả về và cách khắc phục

Nhóm lỗi ổn định giúp ứng dụng phân biệt sự kiện session có thể retry với lỗi chính sách hoặc lỗi thiết bị bảo vệ.

01

Danh mục mã trả về

Return codeTypical causeRemediationRetry
CKR_CRYPTOKI_NOT_INITIALIZEDC_Initialize missing/failedInitialize once under documented threading modelNo
CKR_SLOT_ID_INVALIDUnknown or stale slotRefresh slot list; check failover/token removalConditional
CKR_SESSION_HANDLE_INVALIDSession invalidatedOpen a new session and re-authenticateYes
CKR_USER_NOT_LOGGED_INOperation requires roleLogin under approved roleYes
CKR_PIN_LOCKEDRetry threshold exceededFollow controlled unlock/recoveryNo immediate retry
CKR_MECHANISM_INVALIDMechanism not in release listUse approved mechanism/profileNo
CKR_TEMPLATE_INCONSISTENTObject/key template violates policyCorrect attributes and policyNo automatic retry
CKR_KEY_HANDLE_INVALIDKey missing or handle staleRediscover object by CKA_IDConditional
CKR_DEVICE_ERRORBackend/provider failureCollect correlation; apply approved failoverConditional
CKR_BUFFER_TOO_SMALLCaller buffer insufficientResize using returned lengthYes

02

Liên kết kiểm toán

Application logs should record the Cryptoki return code, operation, slot/token identifier, correlation ID and redacted backend reference. They must never log PINs, private-key material or unredacted SAD/credential data.