|
|
|
@ -17,6 +17,7 @@ import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
|
|
|
|
|
|
|
|
import javax.ws.rs.*;
|
|
|
|
|
import javax.ws.rs.core.Response;
|
|
|
|
|
import java.security.cert.X509Certificate;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -42,8 +43,10 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
|
|
|
|
|
for (EnrollmentCertificate enrollmentCertificate : enrollmentCertificates) {
|
|
|
|
|
certificate = new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
|
|
|
|
|
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
|
|
|
|
|
certificate.setSerial(enrollmentCertificate.getSerial());
|
|
|
|
|
certificate.setCertificate(certificateService.pemToX509Certificate(enrollmentCertificate.getPem()));
|
|
|
|
|
X509Certificate x509Certificate = certificateService
|
|
|
|
|
.pemToX509Certificate(enrollmentCertificate.getPem());
|
|
|
|
|
certificate.setSerial(x509Certificate.getSerialNumber().toString());
|
|
|
|
|
certificate.setCertificate(x509Certificate);
|
|
|
|
|
certificates.add(certificate);
|
|
|
|
|
}
|
|
|
|
|
certificateService.saveCertificate(certificates);
|
|
|
|
|