Филиппов Никита пишет:Добрый день!
Судя по тексту ошибки, у вас указан неверный id в параметрах.
Если на токене только одна ключевая пара, вы можете просто указать
pkcs11:model=Rutoken%20ECP?;pin-value=12345678
Заменив значение в pin-value на ваш PIN-код.
если я указываю
pkcs11:model=Rutoken%20ECP;pin-value=123456 (со своим пином)
или просто указываю без указания пина
pkcs11:model=Rutoken%20ECP;
то я получаю одну и ту же ошибку:
engine "rtengine" set.
cannot load signing key file from engine
1944:error:8208D0F5:lib(130):parse_attr:wrong uri:C:\j\workspace\rtengine-build\315609d0\engine\standalone\p11_uri.c:114:
1944:error:26096080:engine routines:ENGINE_load_private_key:failed loading private key:crypto\engine\eng_pkey.c:78:
unable to load signing key file
т.е. и с пином и БЕЩ пина ошибка одна и та же
если я возвращаю обратно параметр id=0
то по крайней мере оно запрашивает ПИН для ввода, но со старой ошибкой.
через браузер на этом компьютере оно заходит нормально, команда plugin.enumerateDevices() дает результат [0], который я и указал в параметре id=
для диагностики я положил объект plugin в JSON, чтобы было понятно что указывать в устройстве, чтобы получить к нему доступ (приходится указывать текст, полностью, так как прикрепление файлов запрещено)
{"BINARY_FILE_INFO_PRIVATE":0,"BIO_TYPE_NOT_SPECIFIED":1,"BIO_TYPE_NOT_SUPPORTED":0,"CERT_CATEGORY_CA":2,"CERT_CATEGORY_OTHER":3,"CERT_CATEGORY_UNSPEC":0,"CERT_CATEGORY_USER":1,"CERT_INFO_SERIAL_NUMBER":0,"CIPHER_ALGORITHM_AES128":4,"CIPHER_ALGORITHM_AES192":8,"CIPHER_ALGORITHM_AES256":16,"CIPHER_ALGORITHM_GOST28147":32,"DATA_FORMAT_BASE64":1,"DATA_FORMAT_HASH":2,"DATA_FORMAT_PLAIN":0,"DEVICE_DATA_FORMAT_PINPAD2":4,"DEVICE_DATA_FORMAT_PLAIN":1,"DEVICE_DATA_FORMAT_RAW":2,"DEVICE_DATA_FORMAT_SAFETOUCH":16,"DEVICE_DATA_FORMAT_XML":8,"ENUMERATE_DEVICES_EVENTS":2,"ENUMERATE_DEVICES_LIST":1,"ENUMERATE_DEVICES_UNDEFINED":0,"HASH_TYPE_GOST3411_12_256":2,"HASH_TYPE_GOST3411_12_512":4,"HASH_TYPE_GOST3411_94":1,"HASH_TYPE_MD5":8,"HASH_TYPE_SHA1":16,"HASH_TYPE_SHA256":32,"HASH_TYPE_SHA384":48,"HASH_TYPE_SHA512":64,"INTERFACE_TYPE_BT":2,"INTERFACE_TYPE_ISO":8,"INTERFACE_TYPE_NFC_TYPE_A":128,"INTERFACE_TYPE_NFC_TYPE_B":32,"INTERFACE_TYPE_SD":16,"INTERFACE_TYPE_UART":4,"INTERFACE_TYPE_USB":1,"KEY_INFO_ALGORITHM":1,"KEY_INFO_SPEC":2,"KEY_INFO_USAGE_PERIOD":3,"KEY_SPEC_SIGN":0,"KEY_SPEC_SIGN_AND_EXCHANGE":1,"KEY_TYPE_COMMON":0,"KEY_TYPE_JOURNAL":1,"PUBLIC_KEY_ALGORITHM_EXCHANGE_VKO_GOST3410_2001":1,"PUBLIC_KEY_ALGORITHM_EXCHANGE_VKO_GOST3410_2012_256":2,"PUBLIC_KEY_ALGORITHM_EXCHANGE_VKO_GOST3410_2012_512":4,"PUBLIC_KEY_ALGORITHM_GOST3410_2001":1,"PUBLIC_KEY_ALGORITHM_GOST3410_2012_256":2,"PUBLIC_KEY_ALGORITHM_GOST3410_2012_512":4,"PUBLIC_KEY_ALGORITHM_RSA":8,"PUBLIC_KEY_ALGORITHM_RSA_1024":1024,"PUBLIC_KEY_ALGORITHM_RSA_1280":2048,"PUBLIC_KEY_ALGORITHM_RSA_1536":4096,"PUBLIC_KEY_ALGORITHM_RSA_1792":8192,"PUBLIC_KEY_ALGORITHM_RSA_2048":16384,"PUBLIC_KEY_ALGORITHM_RSA_4096":32768,"PUBLIC_KEY_ALGORITHM_RSA_512":256,"PUBLIC_KEY_ALGORITHM_RSA_768":512,"SECURE_MESSAGING_ENHANCED":2,"SECURE_MESSAGING_NOT_SPECIFIED":4,"SECURE_MESSAGING_OFF":0,"SECURE_MESSAGING_ON":1,"SECURE_MESSAGING_UNSUPPORTED":3,"TOKEN_INFO_ALGORITHMS":10,"TOKEN_INFO_DEVICE_TYPE":0,"TOKEN_INFO_FEATURES":8,"TOKEN_INFO_FKN_SUPPORTED":14,"TOKEN_INFO_FORMATS":7,"TOKEN_INFO_FREE_MEMORY":15,"TOKEN_INFO_IS_LOGGED_IN":1,"TOKEN_INFO_IS_PIN_CACHED":2,"TOKEN_INFO_LABEL":3,"TOKEN_INFO_MODEL":4,"TOKEN_INFO_PINS_INFO":13,"TOKEN_INFO_PIN_RETRIES_LEFT":12,"TOKEN_INFO_READER":6,"TOKEN_INFO_SERIAL":5,"TOKEN_INFO_SPEED":9,"TOKEN_INFO_SUPPORTED_MECHANISMS":11,"TOKEN_INFO_VENDOR_MODEL_NAME":16,"TOKEN_TYPE_RUTOKEN_ECP":1,"TOKEN_TYPE_RUTOKEN_ECP_SC":4,"TOKEN_TYPE_RUTOKEN_PINPAD_2":3,"TOKEN_TYPE_RUTOKEN_WEB":2,"TOKEN_TYPE_UNKNOWN":0,"valid":true,"value":"<JSAPI-Auto Javascript Object>","version":"4.10.1.0","errorCodes":{"ALREADY_LOGGED_IN":93,"ASN1_ERROR":33,"ATTRIBUTE_READ_ONLY":89,"ATTRIBUTE_SENSITIVE":96,"ATTRIBUTE_TYPE_INVALID":97,"ATTRIBUTE_VALUE_INVALID":98,"BAD_PARAMS":2,"BASE64_DECODE_FAILED":32,"BF_ALREADY_EXISTS":188,"BF_CANNOT_REMOVE":185,"BF_EMPTY_NAME":186,"BF_FAILED_TO_ENUMERATE":189,"BF_LARGER_THAN_ACCEPTABLE":187,"BF_NOT_FOUND":184,"BF_TOO_MANY_FILES":190,"BUFFER_TOO_SMALL":99,"CANNOT_SAVE_PIN_IN_CACHE":90,"CANT_HARDWARE_VERIFY_CMS":166,"CANT_LOCK":101,"CA_CERTIFICATES_NOT_FOUND":12,"CEK_NOT_AUTHENTIC":94,"CERTIFICATE_CATEGORY_BAD":5,"CERTIFICATE_EXISTS":6,"CERTIFICATE_HASH_NOT_UNIQUE":23,"CERTIFICATE_NOT_FOUND":22,"CERTIFICATE_VERIFICATION_ERROR":13,"CMS_CERTIFICATE_ALREADY_PRESENT":91,"CRYPTOKI_ALREADY_INITIALIZED":102,"DATA_INVALID":27,"DATA_LEN_RANGE":103,"DECRYPT_UNSUCCESSFUL":167,"DESERIALIZE_RESPONSE_BODY_ERROR":191,"DEVICE_ERROR":26,"DEVICE_NOT_FOUND":3,"DIDNOT_FIND_SESSION":136,"DUPLICATE_EXTENSION":202,"EMPTY_RESPONSE_BODY":196,"FUNCTION_FAILED":31,"FUNCTION_REJECTED":30,"HOST_NOT_FOUND":180,"HOST_RESOLVE_ERROR":195,"HTTP_ERROR":181,"INAPPROPRIATE_PIN":168,"INFORMATION_SENSITIVE":106,"KEY_FUNCTION_NOT_PERMITTED":29,"KEY_HANDLE_INVALID":112,"KEY_ID_NOT_UNIQUE":21,"KEY_INDIGESTIBLE":113,"KEY_LABEL_NOT_UNIQUE":10,"KEY_NEEDED":114,"KEY_NOT_FOUND":20,"KEY_NOT_NEEDED":115,"KEY_NOT_WRAPPABLE":116,"KEY_SIZE_RANGE":117,"KEY_SPEC_VALUE_INCOMPATIBLE_WITH_GEN_PARAMS":200,"KEY_SPEC_VALUE_NOT_SUPPORTED_BY_DEVICE":201,"KEY_UNEXTRACTABLE":118,"LICENCE_READ_ONLY":95,"MECHANISM_INVALID":147,"MECHANISM_PARAM_INVALID":148,"MUTEX_BAD":141,"MUTEX_NOT_LOCKED":142,"NEED_TO_CREATE_THREADS":162,"NEW_PIN_MODE":163,"NEXT_OTP":164,"NOT_ENOUGH_MEMORY":15,"NO_EVENT":165,"OBJECT_HANDLE_INVALID":143,"OPERATION_ACTIVE":145,"OPERATION_NOT_INITIALIZED":146,"PEM_ERROR":34,"PIN_CHANGED":8,"PIN_EXPIRED":122,"PIN_INCORRECT":17,"PIN_INVALID":123,"PIN_IN_HISTORY":169,"PIN_LENGTH_INVALID":16,"PIN_LOCKED":18,"PKCS11_CANCEL":100,"PKCS11_LOAD_FAILED":14,"PKCS11_OK":144,"PRIVATE_KEY_USAGE_PERIOD_NOT_OVERRIDABLE":199,"PRIVATE_KEY_USAGE_PERIOD_VALUE_INVALID":198,"PRIVATE_KEY_USAGE_PERIOD_VALUE_NOT_SUPPORTED":197,"RANDOM_NO_RNG":124,"RANDOM_SEED_NOT_SUPPORTED":125,"SAVED_STATE_INVALID":126,"SERVER_CONNECTION_ERROR":192,"SERVER_RECEIVE_ERROR":194,"SERVER_SEND_ERROR":193,"SESSION_CLOSED":119,"SESSION_COUNT":120,"SESSION_EXISTS":121,"SESSION_INVALID":9,"SESSION_PARALLEL_NOT_SUPPORTED":137,"SESSION_READ_ONLY":138,"SESSION_READ_ONLY_EXISTS":139,"SESSION_READ_WRITE_SO_EXISTS":140,"SIGNATURE_INVALID":149,"SIGNATURE_LEN_RANGE":150,"SLOT_ID_INVALID":151,"STATE_UNSAVEBLE":152,"TEMPLATE_INCOMPLETE":153,"TOKEN_INVALID":24,"TOKEN_NOT_PRESENT":130,"TOKEN_NOT_RECOGNIZED":131,"TOKEN_WRITE_PROTECTED":132,"TST_VERIFICATION_ERROR":182,"TS_ESS_SIGNING_CERT_ERROR":174,"TS_MUST_BE_ONE_SIGNER":172,"TS_NONCE_NOT_RETURNED":177,"TS_NO_CONTENT":173,"TS_POLICY_MISMATCH":176,"TS_TOKEN_MISSED":170,"TS_TSA_UNTRUSTED":178,"TS_UNSUPPORTED_VERSION":175,"TS_WRONG_CONTENT_TYPE":171,"UNKNOWN_KEY_TYPE":133,"UNKNOWN_OBJECT_NAME":183,"UNKNOWN_OID":134,"UNSUPPORTED_BY_TOKEN":28,"UNWRAPPING_KEY_HANDLE_INVALID":155,"UNWRAPPING_KEY_SIZE_RANGE":156,"UNWRAPPING_KEY_TYPE_INCONSISTENT":157,"USER_ANOTHER_ALREADY_LOGGED_IN":154,"USER_NOT_LOGGED_IN":19,"USER_PIN_NOT_INITIALIZED":127,"USER_TOO_MANY_TYPES":128,"USER_TYPE_INVALID":129,"WRAPPED_KEY_LEN_RANGE":158,"WRAPPING_KEY_HANDLE_INVALID":159,"WRAPPING_KEY_SIZE_RANGE":160,"WRAPPING_KEY_TYPE_INCONSISTENT":161,"WRONG_BIG_NUMBER":135,"WRONG_KEY_TYPE":25,"X509V3_INVALID_OBJECT_IDENTIFIER":179,"X509_AKID_ISSUER_SERIAL_MISMATCH":69,"X509_AKID_SKID_MISMATCH":68,"X509_APPLICATION_VERIFICATION":66,"X509_CERT_CHAIN_TOO_LONG":56,"X509_CERT_HAS_EXPIRED":45,"X509_CERT_NOT_YET_VALID":43,"X509_CERT_REJECTED":65,"X509_CERT_REVOKED":57,"X509_CERT_SIGNATURE_FAILURE":41,"X509_CERT_UNTRUSTED":64,"X509_CRL_HAS_EXPIRED":46,"X509_CRL_NOT_YET_VALID":44,"X509_CRL_PATH_VALIDATION_ERROR":88,"X509_CRL_SIGNATURE_FAILURE":42,"X509_DEPTH_ZERO_SELF_SIGNED_CERT":52,"X509_DIFFERENT_CRL_SCOPE":79,"X509_ERROR_IN_CERT_NOT_AFTER_FIELD":48,"X509_ERROR_IN_CERT_NOT_BEFORE_FIELD":47,"X509_ERROR_IN_CRL_LAST_UPDATE_FIELD":49,"X509_ERROR_IN_CRL_NEXT_UPDATE_FIELD":50,"X509_EXCLUDED_VIOLATION":83,"X509_INVALID_CA":58,"X509_INVALID_EXTENSION":76,"X509_INVALID_NON_CA":59,"X509_INVALID_POLICY_EXTENSION":77,"X509_INVALID_PURPOSE":63,"X509_KEYUSAGE_NO_CERTSIGN":70,"X509_KEYUSAGE_NO_CRL_SIGN":73,"X509_KEYUSAGE_NO_DIGITAL_SIGNATURE":74,"X509_NO_EXPLICIT_POLICY":78,"X509_OUT_OF_MEM":51,"X509_PATH_LENGTH_EXCEEDED":60,"X509_PERMITTED_VIOLATION":82,"X509_PROXY_CERTIFICATES_NOT_ALLOWED":62,"X509_PROXY_PATH_LENGTH_EXCEEDED":61,"X509_SELF_SIGNED_CERT_IN_CHAIN":53,"X509_SUBJECT_ISSUER_MISMATCH":67,"X509_SUBTREE_MINMAX":84,"X509_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY":40,"X509_UNABLE_TO_DECRYPT_CERT_SIGNATURE":38,"X509_UNABLE_TO_DECRYPT_CRL_SIGNATURE":39,"X509_UNABLE_TO_GET_CRL":37,"X509_UNABLE_TO_GET_CRL_ISSUER":71,"X509_UNABLE_TO_GET_ISSUER_CERT":36,"X509_UNABLE_TO_GET_ISSUER_CERT_LOCALLY":54,"X509_UNABLE_TO_VERIFY_LEAF_SIGNATURE":55,"X509_UNHANDLED_CRITICAL_CRL_EXTENSION":75,"X509_UNHANDLED_CRITICAL_EXTENSION":72,"X509_UNNESTED_RESOURCE":81,"X509_UNSUPPORTED_CONSTRAINT_SYNTAX":86,"X509_UNSUPPORTED_CONSTRAINT_TYPE":85,"X509_UNSUPPORTED_EXTENSION_FEATURE":80,"X509_UNSUPPORTED_NAME_SYNTAX":87,"valid":true,"value":"<JSAPI-Auto Javascript Object>"}}
формирование подписи в браузере проходит нормально, но мне надо подружить 1С в автомате, она с браузером не дружит.