SCMError
public enum SCMError : Error
Represents an error that can be thrown or returned from function of the API.
Generally, whenever a completionHandler
returns a NSError
, a SCMError
may be present through NSError.scmError
to describe the error.
Example:
pin.login(value: "****") { error in
if let error = error {
if (error.scmError == SCMError.CKR_PIN_INCORRECT) {
// pin value is incorrect
}
else if (error.scmError == SCMError.CKR_PIN_LOCKED) {
// pin is locked
}
else {
// check other errors...
}
}
else {
// login is sucessful
}
}
See also
NSError.scmError
-
An unrecoverable error occurred. This may be due to an inconsistency in the smart card data.
Declaration
Swift
case CKR_GENERAL_ERROR
-
The operation failed for some unknown reason. Please try again.
Declaration
Swift
case CKR_FUNCTION_FAILED
-
The token object cannot be modified because it is read-only.
Declaration
Swift
case CKR_ATTRIBUTE_READ_ONLY
-
The token object cannot be read because it is sensitive.
Declaration
Swift
case CKR_ATTRIBUTE_SENSITIVE
-
The object attribute is invalid.
Declaration
Swift
case CKR_ATTRIBUTE_TYPE_INVALID
-
The value of the object attribute is invalid.
Declaration
Swift
case CKR_ATTRIBUTE_VALUE_INVALID
-
The data is invalid.
Declaration
Swift
case CKR_DATA_INVALID
-
The length of the data is inconsistent.
Declaration
Swift
case CKR_DATA_LEN_RANGE
-
An error occurred during the communication with the token.
Declaration
Swift
case CKR_DEVICE_ERROR
-
There is not enough memory space available in the token.
Declaration
Swift
case CKR_DEVICE_MEMORY
-
The token has been removed during the operation.
Declaration
Swift
case CKR_DEVICE_REMOVED
-
The encrypted data is invalid.
Declaration
Swift
case CKR_ENCRYPTED_DATA_INVALID
-
The length of the encrypted data is invalid.
Declaration
Swift
case CKR_ENCRYPTED_DATA_LEN_RANGE
-
The operation has been cancelled.
Declaration
Swift
case CKR_FUNCTION_CANCELED
-
The operation took too long.
Declaration
Swift
case CXR_FUNCTION_TIMED_OUT
-
The operation is not supported by the token.
Declaration
Swift
case CKR_FUNCTION_NOT_SUPPORTED
-
The key size is outside of the range supported for this operation.
Declaration
Swift
case CKR_KEY_SIZE_RANGE
-
The key types are inconsistent for this operation.
Declaration
Swift
case CKR_KEY_TYPE_INCONSISTENT
-
The key does not support this operation.
Declaration
Swift
case CKR_KEY_FUNCTION_NOT_PERMITTED
-
The key cannot be extracted.
Declaration
Swift
case CKR_KEY_UNEXTRACTABLE
-
The cryptographic algorithm is not supported.
Declaration
Swift
case CKR_MECHANISM_INVALID
-
The parameters for the cryptographic operation are incorrect.
Declaration
Swift
case CKR_MECHANISM_PARAM_INVALID
-
The PIN value is incorrect.
Declaration
Swift
case CKR_PIN_INCORRECT
-
The PIN does not have the proper format.
Declaration
Swift
case CKR_PIN_INVALID
-
The length of the PIN is outside of the range.
Declaration
Swift
case CKR_PIN_LEN_RANGE
-
The PIN has expired and needs to be changed.
Declaration
Swift
case CKR_PIN_EXPIRED
-
Due to too many incorrect PINs entered, the card has been locked.
Declaration
Swift
case CKR_PIN_LOCKED
-
The digital signature in invalid.
Declaration
Swift
case CKR_SIGNATURE_INVALID
-
The length of the digital signature is inconsistent.
Declaration
Swift
case CKR_SIGNATURE_LEN_RANGE
-
The token has been removed.
Declaration
Swift
case CKR_TOKEN_NOT_PRESENT
-
The token is not supported.
Declaration
Swift
case CKR_TOKEN_NOT_RECOGNIZED
-
The token is write-protected.
Declaration
Swift
case CKR_TOKEN_WRITE_PROTECTED
-
The user is already logged in.
Declaration
Swift
case CKR_USER_ALREADY_LOGGED_IN
-
The appropriate user is not logged in. You dont’ have the right to perform this operation.
Declaration
Swift
case CKR_USER_NOT_LOGGED_IN
-
The user PIN on this token has never been initially set.
Declaration
Swift
case CKR_USER_PIN_NOT_INITIALIZED
-
There is no such user supported by the token.
Declaration
Swift
case CKR_USER_TYPE_INVALID
-
The information is sensitive and cannot be revealed.
Declaration
Swift
case CKR_INFORMATION_SENSITIVE
-
No valid software license key is available for this card. Please contact your helpdesk to obtain a genuine software license.
Declaration
Swift
case CXR_NO_LICENSE_KEY
-
Bluetooth initialization failed.
Declaration
Swift
case CXR_BT_INITIALIZATION_FAILED
-
Bluetooth scan has not been started or has been stopped.
Declaration
Swift
case CXR_BT_NOT_SCANNING
-
The bluetooth peripheral is not supported.
Declaration
Swift
case CXR_BT_DEVICE_NOT_SUPPORTED
-
The bluetooth peripheral is not detected.
Declaration
Swift
case CXR_BT_DEVICE_NOT_DETECTED
-
The operation is not permitted because a bluetooth peripheral is already paired.
Declaration
Swift
case CXR_BT_ALREADY_PAIRED
-
The AID of the card is not recognized, please be sure to add the correct card AID in the info.plis file.
Declaration
Swift
case CXR_AID_NOT_IN_PLIST_FILE