Revize 586f1573
Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)
static/js/utilities.js | ||
---|---|---|
105 | 105 |
} catch (error) { |
106 | 106 |
console.log(error); |
107 | 107 |
} |
108 |
} |
|
109 |
|
|
110 |
/** |
|
111 |
* Download identity given by certificate id, name and password |
|
112 |
* @param id identifier of certificate to be used for creating the identity |
|
113 |
* @param name name of the resulting identity |
|
114 |
* @param passphrase password protecting the identity |
|
115 |
*/ |
|
116 |
async function onIdentityDownload(id, name, passphrase) { |
|
117 |
try { |
|
118 |
var identityData = { |
|
119 |
name: name, |
|
120 |
password: passphrase |
|
121 |
} |
|
122 |
const response = await axios.post(API_URL + "certificates/" + id + "/identity", identityData); |
|
123 |
if (response.data["success"]) { |
|
124 |
download(name + ".p12", response.data["data"]) |
|
125 |
} else |
|
126 |
console.log("Error occurred while downloading the identity") // TODO more action may be required |
|
127 |
} catch (error) { |
|
128 |
console.log(error); |
|
129 |
} |
|
108 | 130 |
} |
Také k dispozici: Unified diff
Re #8706 - Downloading PKCS#12 identity