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