mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #1097 from wso2/revert-402-EMM-1298
Revert "Fix for EMM-1298"
This commit is contained in:
commit
f0b85c6bfe
@ -73,10 +73,8 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
|
||||
for (EnrollmentCertificate enrollmentCertificate : enrollmentCertificates) {
|
||||
certificate = new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
|
||||
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
|
||||
X509Certificate x509Certificate = certificateService
|
||||
.pemToX509Certificate(enrollmentCertificate.getPem());
|
||||
certificate.setSerial(x509Certificate.getSerialNumber().toString());
|
||||
certificate.setCertificate(x509Certificate);
|
||||
certificate.setSerial(enrollmentCertificate.getSerial());
|
||||
certificate.setCertificate(certificateService.pemToX509Certificate(enrollmentCertificate.getPem()));
|
||||
certificates.add(certificate);
|
||||
}
|
||||
certificateService.saveCertificate(certificates);
|
||||
|
||||
@ -51,6 +51,14 @@
|
||||
<div id="certificate-create-error-msg" class="alert alert-danger hidden" role="alert">
|
||||
<i class="icon fw fw-error"></i><span></span>
|
||||
</div>
|
||||
|
||||
<label class="wr-input-label ">
|
||||
Serial Number *
|
||||
</label>
|
||||
<br>
|
||||
<div id="serialNoInputField" class="form-group wr-input-control">
|
||||
<input type="text" id="serialNo" class="form-control"/>
|
||||
</div>
|
||||
<label class="wr-input-label">Certificate *</label>
|
||||
<div id="certificateField" class="form-group wr-input-control">
|
||||
<input type="file" id="certificate" class="form-control"/>
|
||||
|
||||
@ -92,11 +92,17 @@ $(document).ready(function () {
|
||||
* when a user clicks on "Add Certificate" button.
|
||||
*/
|
||||
$("button#add-certificate-btn").click(function () {
|
||||
if (!pemContent) {
|
||||
var serialNoInput = $("input#serialNo");
|
||||
var serialNo = serialNoInput.val();
|
||||
if (!serialNo) {
|
||||
$(errorMsg).text("Serial Number is a required field. It cannot be empty.");
|
||||
$(errorMsgWrapper).removeClass("hidden");
|
||||
} else if (!pemContent) {
|
||||
$(errorMsg).text(" .pem file must contains certificate information.");
|
||||
$(errorMsgWrapper).removeClass("hidden");
|
||||
} else {
|
||||
var addCertificateFormData = {};
|
||||
addCertificateFormData.serial = serialNo;
|
||||
addCertificateFormData.pem = pemContent;
|
||||
var certificateList = [];
|
||||
certificateList.push(addCertificateFormData);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user