2017-01-17 15:25:57 +03:00
|
|
|
;(function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var $certs = document.querySelector('#certList');
|
2017-12-20 19:06:33 +03:00
|
|
|
|
2017-01-17 15:25:57 +03:00
|
|
|
/**
|
|
|
|
* Пример получения списка сертификатов
|
|
|
|
* */
|
|
|
|
window.CryptoPro.call('getCertsList').then(function (list) {
|
|
|
|
list.forEach(function (cert) {
|
|
|
|
var $certOption = document.createElement('option');
|
|
|
|
|
2017-04-20 12:08:37 +03:00
|
|
|
if (typeof $certOption.textContent !== 'undefined') {
|
|
|
|
$certOption.textContent = cert.label;
|
|
|
|
} else {
|
|
|
|
$certOption.innerText = cert.label;
|
|
|
|
}
|
|
|
|
|
2017-01-17 15:25:57 +03:00
|
|
|
$certOption.value = cert.thumbprint;
|
|
|
|
|
|
|
|
$certs.appendChild($certOption);
|
|
|
|
});
|
|
|
|
}, function (error) {
|
|
|
|
console.error(error);
|
|
|
|
});
|
|
|
|
}());
|