From 44940f31366e78e582ba4b1b9389ee4ec652bf7b Mon Sep 17 00:00:00 2001 From: Janak Amarasena Date: Wed, 3 May 2017 13:58:06 +0530 Subject: [PATCH] Store cert by cert serial --- .../jaxrs/api/impl/CertificateManagementAdminServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java index 1380bc8cbaf..3b014fe693d 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java @@ -75,7 +75,7 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); X509Certificate x509Certificate = certificateService .pemToX509Certificate(enrollmentCertificate.getPem()); - certificate.setSerial(CertificateGenerator.getCommonName(x509Certificate)); + certificate.setSerial(x509Certificate.getSerialNumber().toString()); certificate.setCertificate(x509Certificate); certificates.add(certificate); }