...

Source file src/github.com/miekg/pkcs11/error.go

Documentation: github.com/miekg/pkcs11

     1  // Copyright 2013 Miek Gieben. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package pkcs11
     6  
     7  // awk '/#define CKR_/{ print $3":\""$2"\"," }' pkcs11t.h
     8  
     9  var strerror = map[uint]string{
    10  	0x00000000: "CKR_OK",
    11  	0x00000001: "CKR_CANCEL",
    12  	0x00000002: "CKR_HOST_MEMORY",
    13  	0x00000003: "CKR_SLOT_ID_INVALID",
    14  	0x00000005: "CKR_GENERAL_ERROR",
    15  	0x00000006: "CKR_FUNCTION_FAILED",
    16  	0x00000007: "CKR_ARGUMENTS_BAD",
    17  	0x00000008: "CKR_NO_EVENT",
    18  	0x00000009: "CKR_NEED_TO_CREATE_THREADS",
    19  	0x0000000A: "CKR_CANT_LOCK",
    20  	0x00000010: "CKR_ATTRIBUTE_READ_ONLY",
    21  	0x00000011: "CKR_ATTRIBUTE_SENSITIVE",
    22  	0x00000012: "CKR_ATTRIBUTE_TYPE_INVALID",
    23  	0x00000013: "CKR_ATTRIBUTE_VALUE_INVALID",
    24  	0x00000020: "CKR_DATA_INVALID",
    25  	0x00000021: "CKR_DATA_LEN_RANGE",
    26  	0x00000030: "CKR_DEVICE_ERROR",
    27  	0x00000031: "CKR_DEVICE_MEMORY",
    28  	0x00000032: "CKR_DEVICE_REMOVED",
    29  	0x00000040: "CKR_ENCRYPTED_DATA_INVALID",
    30  	0x00000041: "CKR_ENCRYPTED_DATA_LEN_RANGE",
    31  	0x00000050: "CKR_FUNCTION_CANCELED",
    32  	0x00000051: "CKR_FUNCTION_NOT_PARALLEL",
    33  	0x00000054: "CKR_FUNCTION_NOT_SUPPORTED",
    34  	0x00000060: "CKR_KEY_HANDLE_INVALID",
    35  	0x00000062: "CKR_KEY_SIZE_RANGE",
    36  	0x00000063: "CKR_KEY_TYPE_INCONSISTENT",
    37  	0x00000064: "CKR_KEY_NOT_NEEDED",
    38  	0x00000065: "CKR_KEY_CHANGED",
    39  	0x00000066: "CKR_KEY_NEEDED",
    40  	0x00000067: "CKR_KEY_INDIGESTIBLE",
    41  	0x00000068: "CKR_KEY_FUNCTION_NOT_PERMITTED",
    42  	0x00000069: "CKR_KEY_NOT_WRAPPABLE",
    43  	0x0000006A: "CKR_KEY_UNEXTRACTABLE",
    44  	0x00000070: "CKR_MECHANISM_INVALID",
    45  	0x00000071: "CKR_MECHANISM_PARAM_INVALID",
    46  	0x00000082: "CKR_OBJECT_HANDLE_INVALID",
    47  	0x00000090: "CKR_OPERATION_ACTIVE",
    48  	0x00000091: "CKR_OPERATION_NOT_INITIALIZED",
    49  	0x000000A0: "CKR_PIN_INCORRECT",
    50  	0x000000A1: "CKR_PIN_INVALID",
    51  	0x000000A2: "CKR_PIN_LEN_RANGE",
    52  	0x000000A3: "CKR_PIN_EXPIRED",
    53  	0x000000A4: "CKR_PIN_LOCKED",
    54  	0x000000B0: "CKR_SESSION_CLOSED",
    55  	0x000000B1: "CKR_SESSION_COUNT",
    56  	0x000000B3: "CKR_SESSION_HANDLE_INVALID",
    57  	0x000000B4: "CKR_SESSION_PARALLEL_NOT_SUPPORTED",
    58  	0x000000B5: "CKR_SESSION_READ_ONLY",
    59  	0x000000B6: "CKR_SESSION_EXISTS",
    60  	0x000000B7: "CKR_SESSION_READ_ONLY_EXISTS",
    61  	0x000000B8: "CKR_SESSION_READ_WRITE_SO_EXISTS",
    62  	0x000000C0: "CKR_SIGNATURE_INVALID",
    63  	0x000000C1: "CKR_SIGNATURE_LEN_RANGE",
    64  	0x000000D0: "CKR_TEMPLATE_INCOMPLETE",
    65  	0x000000D1: "CKR_TEMPLATE_INCONSISTENT",
    66  	0x000000E0: "CKR_TOKEN_NOT_PRESENT",
    67  	0x000000E1: "CKR_TOKEN_NOT_RECOGNIZED",
    68  	0x000000E2: "CKR_TOKEN_WRITE_PROTECTED",
    69  	0x000000F0: "CKR_UNWRAPPING_KEY_HANDLE_INVALID",
    70  	0x000000F1: "CKR_UNWRAPPING_KEY_SIZE_RANGE",
    71  	0x000000F2: "CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT",
    72  	0x00000100: "CKR_USER_ALREADY_LOGGED_IN",
    73  	0x00000101: "CKR_USER_NOT_LOGGED_IN",
    74  	0x00000102: "CKR_USER_PIN_NOT_INITIALIZED",
    75  	0x00000103: "CKR_USER_TYPE_INVALID",
    76  	0x00000104: "CKR_USER_ANOTHER_ALREADY_LOGGED_IN",
    77  	0x00000105: "CKR_USER_TOO_MANY_TYPES",
    78  	0x00000110: "CKR_WRAPPED_KEY_INVALID",
    79  	0x00000112: "CKR_WRAPPED_KEY_LEN_RANGE",
    80  	0x00000113: "CKR_WRAPPING_KEY_HANDLE_INVALID",
    81  	0x00000114: "CKR_WRAPPING_KEY_SIZE_RANGE",
    82  	0x00000115: "CKR_WRAPPING_KEY_TYPE_INCONSISTENT",
    83  	0x00000120: "CKR_RANDOM_SEED_NOT_SUPPORTED",
    84  	0x00000121: "CKR_RANDOM_NO_RNG",
    85  	0x00000130: "CKR_DOMAIN_PARAMS_INVALID",
    86  	0x00000150: "CKR_BUFFER_TOO_SMALL",
    87  	0x00000160: "CKR_SAVED_STATE_INVALID",
    88  	0x00000170: "CKR_INFORMATION_SENSITIVE",
    89  	0x00000180: "CKR_STATE_UNSAVEABLE",
    90  	0x00000190: "CKR_CRYPTOKI_NOT_INITIALIZED",
    91  	0x00000191: "CKR_CRYPTOKI_ALREADY_INITIALIZED",
    92  	0x000001A0: "CKR_MUTEX_BAD",
    93  	0x000001A1: "CKR_MUTEX_NOT_LOCKED",
    94  	0x000001B0: "CKR_NEW_PIN_MODE",
    95  	0x000001B1: "CKR_NEXT_OTP",
    96  	0x00000200: "CKR_FUNCTION_REJECTED",
    97  	0x80000000: "CKR_VENDOR_DEFINED",
    98  }
    99  

View as plain text