mirror of
				https://github.com/crypto-pro-web/crypto-pro-js.git
				synced 2025-10-31 14:23:22 +03:00 
			
		
		
		
	1.0.4
This commit is contained in:
		
							parent
							
								
									ce37ea6d7c
								
							
						
					
					
						commit
						2b3b13c268
					
				| @ -1,3 +1,8 @@ | ||||
| 1.0.4 / 2017-01-20 | ||||
| ================== | ||||
| 
 | ||||
|   * Улучшение: Добавлены изменения из оригинального js модуля Крипто ПРО "2.0.3" [ссылка на оригинальный файл](https://www.cryptopro.ru/sites/default/files/products/cades/cadesplugin_api.js) | ||||
| 
 | ||||
| 1.0.3 / 2017-01-20 | ||||
| ================== | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										48
									
								
								dist/crypto-pro.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								dist/crypto-pro.js
									
									
									
									
										vendored
									
									
								
							| @ -236,6 +236,10 @@ var CryptoPro = | ||||
| 	    } | ||||
| 	 | ||||
| 	    function cpcsp_console_log(level, msg) { | ||||
| 	        if (typeof console === 'undefined') { | ||||
| 	            return; | ||||
| 	        } | ||||
| 	 | ||||
| 	        if (level <= cadesplugin.current_log_level) { | ||||
| 	            if (level == cadesplugin.LOG_LEVEL_DEBUG) { | ||||
| 	                console.log('DEBUG: %s', msg); | ||||
| @ -294,6 +298,9 @@ var CryptoPro = | ||||
| 	    function set_constantValues() { | ||||
| 	        cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1; | ||||
| 	        cadesplugin.CAPICOM_CURRENT_USER_STORE = 2; | ||||
| 	        cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1; | ||||
| 	        cadesplugin.CADESCOM_CURRENT_USER_STORE = 2; | ||||
| 	        cadesplugin.CADESCOM_CONTAINER_STORE = 100; | ||||
| 	        cadesplugin.CAPICOM_MY_STORE = 'My'; | ||||
| 	        cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; | ||||
| 	        cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; | ||||
| @ -481,6 +488,38 @@ var CryptoPro = | ||||
| 	        return pluginObject.CreateObject(name); | ||||
| 	    } | ||||
| 	 | ||||
| 	    function decimalToHexString(number) { | ||||
| 	        if (number < 0) { | ||||
| 	            number = 0xFFFFFFFF + number + 1; | ||||
| 	        } | ||||
| 	 | ||||
| 	        return number.toString(16).toUpperCase(); | ||||
| 	    } | ||||
| 	 | ||||
| 	    function GetMessageFromException(e) { | ||||
| 	        var err = e.message; | ||||
| 	 | ||||
| 	        if (!err) { | ||||
| 	            err = e; | ||||
| 	        } else if (e.number) { | ||||
| 	            err += ' (0x' + decimalToHexString(e.number) + ')'; | ||||
| 	        } | ||||
| 	 | ||||
| 	        return err; | ||||
| 	    } | ||||
| 	 | ||||
| 	    function getLastError(exception) { | ||||
| 	        if (isChromiumBased() || isIE() || isIOS()) { | ||||
| 	            return GetMessageFromException(exception); | ||||
| 	        } | ||||
| 	 | ||||
| 	        try { | ||||
| 	            return pluginObject.getLastError(); | ||||
| 	        } catch (e) { | ||||
| 	            return GetMessageFromException(exception); | ||||
| 	        } | ||||
| 	    } | ||||
| 	 | ||||
| 	    // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in
 | ||||
| 	    function CreateObjectAsync(name) { | ||||
| 	        return pluginObject.CreateObjectAsync(name); | ||||
| @ -662,7 +701,7 @@ var CryptoPro = | ||||
| 	 | ||||
| 	        elem.setAttribute('id', 'cadesplugin_object'); | ||||
| 	        elem.setAttribute('type', 'application/x-cades'); | ||||
| 	        elem.setAttribute('style', 'visibility=hidden'); | ||||
| 	        elem.setAttribute('style', 'visibility: hidden'); | ||||
| 	        document.getElementsByTagName('body')[0].appendChild(elem); | ||||
| 	 | ||||
| 	        pluginObject = document.getElementById('cadesplugin_object'); | ||||
| @ -672,13 +711,13 @@ var CryptoPro = | ||||
| 	 | ||||
| 	            elem1.setAttribute('id', 'certEnrollClassFactory'); | ||||
| 	            elem1.setAttribute('classid', 'clsid:884e2049-217d-11da-b2a4-000e7bbb2b09'); | ||||
| 	            elem1.setAttribute('style', 'visibility=hidden'); | ||||
| 	            elem1.setAttribute('style', 'visibility: hidden'); | ||||
| 	            document.getElementsByTagName('body')[0].appendChild(elem1); | ||||
| 	 | ||||
| 	            var elem2 = document.createElement('object'); | ||||
| 	            elem2.setAttribute('id', 'webClassFactory'); | ||||
| 	            elem2.setAttribute('classid', 'clsid:B04C8637-10BD-484E-B0DA-B8A039F60024'); | ||||
| 	            elem2.setAttribute('style', 'visibility=hidden'); | ||||
| 	            elem2.setAttribute('style', 'visibility: hidden'); | ||||
| 	 | ||||
| 	            document.getElementsByTagName('body')[0].appendChild(elem2); | ||||
| 	        } | ||||
| @ -785,10 +824,11 @@ var CryptoPro = | ||||
| 	    } | ||||
| 	 | ||||
| 	    // Export
 | ||||
| 	    cadesplugin.JSModuleVersion = '2.0.2'; | ||||
| 	    cadesplugin.JSModuleVersion = '2.0.3'; | ||||
| 	    cadesplugin.async_spawn = async_spawn; | ||||
| 	    cadesplugin.set = set_pluginObject; | ||||
| 	    cadesplugin.set_log_level = set_log_level; | ||||
| 	    cadesplugin.getLastError = getLastError; | ||||
| 	 | ||||
| 	    if (isChromiumBased()) { | ||||
| 	        cadesplugin.CreateObjectAsync = CreateObjectAsync; | ||||
|  | ||||
							
								
								
									
										2
									
								
								dist/crypto-pro.js.map
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/crypto-pro.js.map
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "crypto-pro", | ||||
|   "version": "1.0.3", | ||||
|   "version": "1.0.4", | ||||
|   "description": "API для взаимодействия с КриптоПро", | ||||
|   "main": "index.js", | ||||
|   "scripts": { | ||||
|  | ||||
							
								
								
									
										48
									
								
								src/cades.js
									
									
									
									
									
								
							
							
						
						
									
										48
									
								
								src/cades.js
									
									
									
									
									
								
							| @ -32,6 +32,10 @@ | ||||
|     } | ||||
| 
 | ||||
|     function cpcsp_console_log(level, msg) { | ||||
|         if (typeof console === 'undefined') { | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         if (level <= cadesplugin.current_log_level) { | ||||
|             if (level == cadesplugin.LOG_LEVEL_DEBUG) { | ||||
|                 console.log('DEBUG: %s', msg); | ||||
| @ -90,6 +94,9 @@ | ||||
|     function set_constantValues() { | ||||
|         cadesplugin.CAPICOM_LOCAL_MACHINE_STORE = 1; | ||||
|         cadesplugin.CAPICOM_CURRENT_USER_STORE = 2; | ||||
|         cadesplugin.CADESCOM_LOCAL_MACHINE_STORE = 1; | ||||
|         cadesplugin.CADESCOM_CURRENT_USER_STORE = 2; | ||||
|         cadesplugin.CADESCOM_CONTAINER_STORE = 100; | ||||
|         cadesplugin.CAPICOM_MY_STORE = 'My'; | ||||
|         cadesplugin.CAPICOM_STORE_OPEN_MAXIMUM_ALLOWED = 2; | ||||
|         cadesplugin.CAPICOM_CERTIFICATE_FIND_SUBJECT_NAME = 1; | ||||
| @ -277,6 +284,38 @@ | ||||
|         return pluginObject.CreateObject(name); | ||||
|     } | ||||
| 
 | ||||
|     function decimalToHexString(number) { | ||||
|         if (number < 0) { | ||||
|             number = 0xFFFFFFFF + number + 1; | ||||
|         } | ||||
| 
 | ||||
|         return number.toString(16).toUpperCase(); | ||||
|     } | ||||
| 
 | ||||
|     function GetMessageFromException(e) { | ||||
|         var err = e.message; | ||||
| 
 | ||||
|         if (!err) { | ||||
|             err = e; | ||||
|         } else if (e.number) { | ||||
|             err += ' (0x' + decimalToHexString(e.number) + ')'; | ||||
|         } | ||||
| 
 | ||||
|         return err; | ||||
|     } | ||||
| 
 | ||||
|     function getLastError(exception) { | ||||
|         if (isChromiumBased() || isIE() || isIOS()) { | ||||
|             return GetMessageFromException(exception); | ||||
|         } | ||||
| 
 | ||||
|         try { | ||||
|             return pluginObject.getLastError(); | ||||
|         } catch (e) { | ||||
|             return GetMessageFromException(exception); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // Функция активации асинхронных объектов КриптоПро ЭЦП Browser plug-in
 | ||||
|     function CreateObjectAsync(name) { | ||||
|         return pluginObject.CreateObjectAsync(name); | ||||
| @ -458,7 +497,7 @@ | ||||
| 
 | ||||
|         elem.setAttribute('id', 'cadesplugin_object'); | ||||
|         elem.setAttribute('type', 'application/x-cades'); | ||||
|         elem.setAttribute('style', 'visibility=hidden'); | ||||
|         elem.setAttribute('style', 'visibility: hidden'); | ||||
|         document.getElementsByTagName('body')[0].appendChild(elem); | ||||
| 
 | ||||
|         pluginObject = document.getElementById('cadesplugin_object'); | ||||
| @ -468,13 +507,13 @@ | ||||
| 
 | ||||
|             elem1.setAttribute('id', 'certEnrollClassFactory'); | ||||
|             elem1.setAttribute('classid', 'clsid:884e2049-217d-11da-b2a4-000e7bbb2b09'); | ||||
|             elem1.setAttribute('style', 'visibility=hidden'); | ||||
|             elem1.setAttribute('style', 'visibility: hidden'); | ||||
|             document.getElementsByTagName('body')[0].appendChild(elem1); | ||||
| 
 | ||||
|             var elem2 = document.createElement('object'); | ||||
|             elem2.setAttribute('id', 'webClassFactory'); | ||||
|             elem2.setAttribute('classid', 'clsid:B04C8637-10BD-484E-B0DA-B8A039F60024'); | ||||
|             elem2.setAttribute('style', 'visibility=hidden'); | ||||
|             elem2.setAttribute('style', 'visibility: hidden'); | ||||
| 
 | ||||
|             document.getElementsByTagName('body')[0].appendChild(elem2); | ||||
|         } | ||||
| @ -581,10 +620,11 @@ | ||||
|     } | ||||
| 
 | ||||
|     // Export
 | ||||
|     cadesplugin.JSModuleVersion = '2.0.2'; | ||||
|     cadesplugin.JSModuleVersion = '2.0.3'; | ||||
|     cadesplugin.async_spawn = async_spawn; | ||||
|     cadesplugin.set = set_pluginObject; | ||||
|     cadesplugin.set_log_level = set_log_level; | ||||
|     cadesplugin.getLastError = getLastError; | ||||
| 
 | ||||
|     if (isChromiumBased()) { | ||||
|         cadesplugin.CreateObjectAsync = CreateObjectAsync; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Vitalii Goma
						Vitalii Goma