Skip to content

Commit

Permalink
imp: save .pem as key with name
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Gozman committed Aug 11, 2016
1 parent 555e1b6 commit a62add6
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ app.controller('keyPairsCtrl', function ($scope, serviceAPI, $routeParams, http,
showOk('Key: ' + $scope.createKeyName + ' generated.');
setTimeout(loadTable(),250);
//console.log(response);
document.location = 'data:application/x-pem-file,' +
encodeURIComponent(response);
var key = document.createElement("a");
key.download = $scope.createKeyName + '.pem';
key.href = 'data:application/x-pem-file,' + encodeURIComponent(response);
key.click();
//document.location = 'title: key.pem, data:application/x-pem-file,' +
// encodeURIComponent(response);
//location.reload();
})
.error(function (response, status) {
Expand Down

0 comments on commit a62add6

Please sign in to comment.