SCMException ============ .. java:package:: com.idopte.scmapi :noindex: .. java:type:: @SuppressWarnings public class SCMException extends Exception Class describes an error resulting from a request to the SCWS service. Fields ------ CKR_OK ^^^^^^ .. java:field:: public static final long CKR_OK :outertype: SCMException Methods ------- getErrorCode ^^^^^^^^^^^^ .. java:method:: public long getErrorCode() :outertype: SCMException Error code, suitable for checking when specific actions need to be taken depending on the cause. Possible values are: .. * \ :java:ref:`SCMException.CKR_CANCEL`\ : The operation succeeded. * \ :java:ref:`SCMException.CKR_HOST_MEMORY`\ : Not enough memory on the host computer. * \ :java:ref:`SCMException.CKR_SLOT_ID_INVALID`\ : "The selected slot ID is invalid. * \ :java:ref:`SCMException.CKR_GENERAL_ERROR`\ : An unrecoverable error occurred. This may be due to an inconsistency in the smart card data. * \ :java:ref:`SCMException.CKR_FUNCTION_FAILED`\ : The operation failed for an unknown reason. * \ :java:ref:`SCMException.CKR_ARGUMENTS_BAD`\ : Bad argument were passed to the function. * \ :java:ref:`SCMException.CKR_ATTRIBUTE_READ_ONLY`\ : The token object cannot be modified because it is read-only. * \ :java:ref:`SCMException.CKR_ATTRIBUTE_SENSITIVE`\ : The token object cannot be read because it is sensitive. * \ :java:ref:`SCMException.CKR_ATTRIBUTE_TYPE_INVALID`\ : The object attribute is invalid. * \ :java:ref:`SCMException.CKR_ATTRIBUTE_VALUE_INVALID`\ : The value of the object attribute is invalid. * \ :java:ref:`SCMException.CKR_ACTION_PROHIBITED`\ : The action cannot be done because it is prohibited by the token. * \ :java:ref:`SCMException.CKR_DATA_INVALID`\ : The data is invalid. * \ :java:ref:`SCMException.CKR_DATA_LEN_RANGE`\ : The length of the data is inconsistent. * \ :java:ref:`SCMException.CKR_DEVICE_ERROR`\ : An error occurred during the communication with the card. * \ :java:ref:`SCMException.CKR_DEVICE_MEMORY`\ : There is not enough memory space available in the card. * \ :java:ref:`SCMException.CKR_DEVICE_REMOVED`\ : The card has been removed during the operation. * \ :java:ref:`SCMException.CKR_ENCRYPTED_DATA_INVALID`\ : The encrypted data is invalid. * \ :java:ref:`SCMException.CKR_ENCRYPTED_DATA_LEN_RANGE`\ : The length of the encrypted data is invalid. * \ :java:ref:`SCMException.CKR_FUNCTION_CANCELED`\ : The operation has been cancelled. * \ :java:ref:`SCMException.CKR_FUNCTION_NOT_PARALLEL`\ : The function cannot be executed in parallel * \ :java:ref:`SCMException.CKR_FUNCTION_NOT_SUPPORTED`\ : The operation is not supported by the card. * \ :java:ref:`SCMException.CKR_KEY_HANDLE_INVALID`\ : The specified key is not valid. * \ :java:ref:`SCMException.CKR_KEY_SIZE_RANGE`\ : The key size is outside of the range supported for this operation. * \ :java:ref:`SCMException.CKR_KEY_TYPE_INCONSISTENT`\ : The key types are inconsistent for this operation. * \ :java:ref:`SCMException.CKR_KEY_NOT_NEEDED`\ : An extraneous key was supplied. * \ :java:ref:`SCMException.CKR_KEY_CHANGED`\ : One of the keys specified is not the same key that was being used in the original saved session. * \ :java:ref:`SCMException.CKR_KEY_NEEDED`\ : The session state cannot be restored it because needs to be supplied with one or more keys that were being used in the original saved session. * \ :java:ref:`SCMException.CKR_KEY_INDIGESTIBLE`\ : The key cannot be digested. * \ :java:ref:`SCMException.CKR_KEY_NOT_WRAPPABLE`\ : The key cannot be wrapped. * \ :java:ref:`SCMException.CKR_KEY_FUNCTION_NOT_PERMITTED`\ : The key does not support this operation. * \ :java:ref:`SCMException.CKR_KEY_UNEXTRACTABLE`\ : The key cannot be extracted. * \ :java:ref:`SCMException.CKR_MECHANISM_INVALID`\ : The cryptographic algorithm is not supported. * \ :java:ref:`SCMException.CKR_MECHANISM_PARAM_INVALID`\ : The parameters for the cryptographic operation are incorrect. * \ :java:ref:`SCMException.CKR_OBJECT_HANDLE_INVALID`\ : The specified object handle is not valid. * \ :java:ref:`SCMException.CKR_OPERATION_ACTIVE`\ : There is already an active operation which prevents Cryptoki from activating the specified operation. * \ :java:ref:`SCMException.CKR_OPERATION_NOT_INITIALIZED`\ : There is no active operation of an appropriate type in the specified session. * \ :java:ref:`SCMException.CKR_PIN_INCORRECT`\ : The PIN value is incorrect. * \ :java:ref:`SCMException.CKR_PIN_INVALID`\ : The PIN does not have the proper format. * \ :java:ref:`SCMException.CKR_PIN_LEN_RANGE`\ : The length of the PIN is outside of the range. * \ :java:ref:`SCMException.CKR_PIN_EXPIRED`\ : The PIN has expired and needs to be changed. * \ :java:ref:`SCMException.CKR_PIN_LOCKED`\ : The PIN has been blocked. * \ :java:ref:`SCMException.CKR_SIGNATURE_INVALID`\ : The digital signature in invalid. * \ :java:ref:`SCMException.CKR_SIGNATURE_LEN_RANGE`\ : The length od the digital signature is incorrect. * \ :java:ref:`SCMException.CKR_TOKEN_NOT_PRESENT`\ : The token has been removed. * \ :java:ref:`SCMException.CKR_TOKEN_NOT_RECOGNIZED`\ : The token is not supported. * \ :java:ref:`SCMException.CKR_TOKEN_WRITE_PROTECTED`\ : The token is write-protected. * \ :java:ref:`SCMException.CKR_UNWRAPPING_KEY_HANDLE_INVALID`\ : The key handle specified to be used to unwrap another key is not valid. * \ :java:ref:`SCMException.CKR_UNWRAPPING_KEY_SIZE_RANGE`\ : The size of the unwrapping key is outside of the range supported for this operation. * \ :java:ref:`SCMException.CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT`\ : The type of the unwrapping key is not supported for this operation. * \ :java:ref:`SCMException.CKR_USER_ALREADY_LOGGED_IN`\ : The user is already logged in. * \ :java:ref:`SCMException.CKR_USER_NOT_LOGGED_IN`\ : The appropriate user is not logged in. * \ :java:ref:`SCMException.CKR_USER_PIN_NOT_INITIALIZED`\ : The user PIN on this token has never been initially set. * \ :java:ref:`SCMException.CKR_USER_TYPE_INVALID`\ : The required user type is not defined for this card. * \ :java:ref:`SCMException.CKR_USER_ANOTHER_ALREADY_LOGGED_IN`\ : Another user is currently logged in. * \ :java:ref:`SCMException.CKR_USER_TOO_MANY_TYPES`\ : Too many users are logged in the token. * \ :java:ref:`SCMException.CKR_WRAPPED_KEY_INVALID`\ : The size of the wrapped key is outside of the range supported for this operation. * \ :java:ref:`SCMException.CKR_WRAPPED_KEY_LEN_RANGE`\ : The type of the wrapped key is not supported for this operation. * \ :java:ref:`SCMException.CKR_WRAPPING_KEY_HANDLE_INVALID`\ : The key handle specified to be used to wrap another key is not valid. * \ :java:ref:`SCMException.CKR_WRAPPING_KEY_SIZE_RANGE`\ : The size of the wrapping key is outside of the range supported for this operation. * \ :java:ref:`SCMException.CKR_WRAPPING_KEY_TYPE_INCONSISTENT`\ : The type of the wrapping key is not supported for this operation. * \ :java:ref:`SCMException.CKR_DOMAIN_PARAMS_INVALID`\ : Invalid or unsupported domain parameters were supplied to the function. * \ :java:ref:`SCMException.CKR_CURVE_NOT_SUPPORTED`\ : This curve is not supported by this token. * \ :java:ref:`SCMException.CKR_BUFFER_TOO_SMALL`\ : The output of the function is too large to fit in the supplied buffer. * \ :java:ref:`SCMException.CKR_INFORMATION_SENSITIVE`\ : The information is private and cannot be revealed. * \ :java:ref:`SCMException.CKR_EXCEEDED_MAX_ITERATIONS`\ : An iterative algorithm failed because we have exceeded the maximum number of iterations. * \ :java:ref:`SCMException.CKR_LIBRARY_LOAD_FAILED`\ : The Cryptoki library could not load a dependent shared library. * \ :java:ref:`SCMException.CKR_PIN_TOO_WEAK`\ : The new PIN must be different from the current one and recent previous PINs. * \ :java:ref:`SCMException.CKR_PUBLIC_KEY_INVALID`\ : The public key fails a public key validation. * \ :java:ref:`SCMException.CKR_FUNCTION_REJECTED`\ : The signature request is rejected by the user. * \ :java:ref:`SCMException.CXR_NO_LICENSE_KEY`\ : The software license key is invalid. * \ :java:ref:`SCMException.CXR_PUK_ALREADY_USED`\ : The Puk is already used. * \ :java:ref:`SCMException.CXR_PIN_UNBLOCK_BLOCKED`\ : The PIN cannot be unblocked anymore. The maximum number of unlock attempts has been reached. * \ :java:ref:`SCMException.CXR_NOT_PERMITTED`\ : The software license key is invalid. * \ :java:ref:`SCMException.CXR_BT_INITIALIZATION_FAILED`\ : Bluetooth initialization failed. * \ :java:ref:`SCMException.CXR_BT_NOT_SCANNING`\ : Bluetooth scan has not been started or has been stopped. * \ :java:ref:`SCMException.CXR_BT_DEVICE_NOT_SUPPORTED`\ : The bluetooth peripheral is not supported. * \ :java:ref:`SCMException.CXR_BT_DEVICE_NOT_DETECTED`\ : The bluetooth peripheral is not detected. * \ :java:ref:`SCMException.CXR_BT_ALREADY_PAIRED`\ : The operation is not permitted because a bluetooth peripheral is already paired. * \ :java:ref:`SCMException.CXR_BT_PERMISSIONS_NOT_GRANTED`\ : Bluetooth permissions are not granted. * \ :java:ref:`SCMException.CXR_BT_LOCATION_NOT_ENABLED`\ : Location parameter is not enabled. * \ :java:ref:`SCMException.CXR_PACE_NEEDED`\ : The card needs a Pace before using it. * \ :java:ref:`SCMException.CXR_SIGNATURE_TIMESTAMP`\ : Timestamping step of the signature failed. * \ :java:ref:`SCMException.CXR_CERT_NOT_TRUSTED`\ : The certificate has not been approved by an authority from the trusted zone. * \ :java:ref:`SCMException.CXR_BROKEN_AUTHENTICATION`\ : Secure chanel is broken. * \ :java:ref:`SCMException.MWR_IMPORT_FILE_INVALID`\ : The format of the file is unsupported or the file has been damaged. * \ :java:ref:`SCMException.MWR_IMPORT_PASSWORD_INVALID`\ : The file password is invalid. * \ :java:ref:`SCMException.MWR_IMPORT_KEY_TYPE_UNSUPPORTED`\ : The card does not support the required key type. * \ :java:ref:`SCMException.MWR_IMPORT_KEY_LENGTH_UNSUPPORTED`\ : The card does not support the required key length. * \ :java:ref:`SCMException.MWR_PUK_ALREADY_USED`\ : This PIN unblocking code has laready been used. * \ :java:ref:`SCMException.MWR_SCWS_UNREACHABLE`\ : The SCWS service could not be reached. * \ :java:ref:`SCMException.MWR_SCWS_COMM_ERROR`\ : The communication with the SCWS service failed. * \ :java:ref:`SCMException.MWR_SCWS_COMM_TIMEOUT`\ : The communication with the SCWS service has timed out. * \ :java:ref:`SCMException.MWR_SCWS_BAD_PARAMS`\ : Invalid input parameters. * \ :java:ref:`SCMException.MWR_SCWS_UNKNOWN_ERROR`\ : The SCWS service returned an invalid error code. :return: the error code. getStringCode ^^^^^^^^^^^^^ .. java:method:: public String getStringCode() :outertype: SCMException Human-readable error message. :return: the error message.