Honor selected algorithm during certificate cloning

This commit is contained in:
sayali 2020-08-03 19:22:13 -07:00 committed by Hossein Shafagh
parent d07464f3b1
commit 69b64c63ea
1 changed files with 2 additions and 0 deletions

View File

@ -212,12 +212,14 @@ angular.module('lemur')
})
.controller('CertificateCloneController', function ($scope, $uibModalInstance, CertificateApi, CertificateService, DestinationService, AuthorityService, AuthorityApi, PluginService, MomentService, WizardHandler, LemurRestangular, NotificationService, toaster, editId) {
$scope.certificate = LemurRestangular.restangularizeElement(null, {}, 'certificates');
CertificateApi.get(editId).then(function (certificate) {
$scope.certificate = certificate;
$scope.certificate.name = ''; // we should prefer the generated name
$scope.certificate.csr = null; // should not clone CSR in case other settings are changed in clone
$scope.certificate.validityStart = null;
$scope.certificate.validityEnd = null;
$scope.certificate.keyType = 'RSA2048'; // default algo to show during clone
CertificateService.getDefaults($scope.certificate);
});