Browse Source

test ecdsa support, spaces for whitespace

master
AJ ONeal 6 years ago
parent
commit
c66f92d506
  1. 26
      app/js/app.js

26
app/js/app.js

@ -14,6 +14,32 @@
var PromiseA = window.Promise;
var crypto = window.crypto;
function testEcdsaSupport() {
var opts = {
type: 'ECDSA'
, bitlength: '256'
};
return BACME.accounts.generateKeypair(opts).then(function (jwk) {
return crypto.subtle.importKey(
"jwk"
, jwk
, { name: "ECDSA", namedCurve: "P-256" }
, true
, ["sign"]
).then(function (privateKey) {
return window.crypto.subtle.exportKey("pkcs8", privateKey);
});
});
}
testEcdsaSupport().then(function () {
console.log("supports ECDSA");
BROWSER_SUPPORTS_ECDSA = true;
}).catch(function () {
console.log("DOES NOT supports ECDSA");
BROWSER_SUPPORTS_ECDSA = false;
});
// TODO test RSA support
var apiUrl = 'https://acme-{{env}}.api.letsencrypt.org/directory';
function updateApiType() {
console.log("type updated");

Loading…
Cancel
Save