mirror of
https://github.com/crypto-pro-web/crypto-pro-js.git
synced 2024-11-27 21:06:01 +03:00
26 lines
742 B
JavaScript
26 lines
742 B
JavaScript
;(function () {
|
|
'use strict';
|
|
|
|
var $certs = document.querySelector('#certList');
|
|
|
|
/**
|
|
* Пример получения списка сертификатов
|
|
* */
|
|
window.CryptoPro.call('getCertsList').then(function (list) {
|
|
list.forEach(function (cert) {
|
|
var $certOption = document.createElement('option');
|
|
|
|
if (typeof $certOption.textContent !== 'undefined') {
|
|
$certOption.textContent = cert.label;
|
|
} else {
|
|
$certOption.innerText = cert.label;
|
|
}
|
|
|
|
$certOption.value = cert.thumbprint;
|
|
|
|
$certs.appendChild($certOption);
|
|
});
|
|
}, function (error) {
|
|
console.error(error);
|
|
});
|
|
}()); |