refactored cert mgt component

vpp-v2
Amalka Subasinghe 2 years ago
parent 1d0f27b98e
commit 5d5980c720

@ -159,7 +159,7 @@
</dependency>
<dependency>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.core</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>

@ -48,7 +48,7 @@
</dependency>
<dependency>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.json.wso2</groupId>
@ -96,7 +96,7 @@
org.apache.synapse,
org.apache.synapse.core.axis2,
org.apache.synapse.rest,
org.wso2.carbon.certificate.mgt.core.*
io.entgra.device.mgt.core.certificate.mgt.core.*
</Import-Package>
</instructions>
</configuration>

@ -30,9 +30,9 @@ import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker;
import org.wso2.carbon.apimgt.handlers.invoker.RESTResponse;
import org.wso2.carbon.apimgt.handlers.utils.AuthConstants;
import org.wso2.carbon.apimgt.handlers.utils.Utils;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import javax.security.cert.CertificateEncodingException;

@ -30,7 +30,7 @@ import org.wso2.carbon.apimgt.handlers.beans.DCR;
import org.wso2.carbon.apimgt.handlers.config.IOTServerConfiguration;
import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker;
import org.wso2.carbon.apimgt.handlers.invoker.RESTResponse;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.utils.CarbonUtils;

@ -27,7 +27,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.api</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - Certificate Management API</name>
<description>WSO2 Carbon - Certificate Management API</description>
@ -166,7 +166,7 @@
</dependency>
<dependency>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>

@ -1,10 +1,10 @@
package org.wso2.carbon.certificate.mgt.jaxrs.api;
package io.entgra.device.mgt.core.certificate.mgt.api;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.certificate.mgt.jaxrs.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.api.beans.ErrorResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.HeaderParam;

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.jaxrs.beans;
package io.entgra.device.mgt.core.certificate.mgt.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.jaxrs.beans;
package io.entgra.device.mgt.core.certificate.mgt.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.jaxrs.api.common;
package io.entgra.device.mgt.core.certificate.mgt.api.common;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.jaxrs.api.common;
package io.entgra.device.mgt.core.certificate.mgt.api.common;
/**
* Custom exception class for handling CDM API related exceptions.

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.jaxrs.exception;
package io.entgra.device.mgt.core.certificate.mgt.api.exception;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;

@ -16,9 +16,9 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api;
package io.entgra.device.mgt.core.certificate.mgt.api.exception;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.api.beans.ErrorResponse;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

@ -1,14 +1,14 @@
package org.wso2.carbon.certificate.mgt.jaxrs.api.impl;
package io.entgra.device.mgt.core.certificate.mgt.api.impl;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.jaxrs.beans.ErrorResponse;
import org.wso2.carbon.certificate.mgt.jaxrs.exception.UnexpectedServerErrorException;
import org.wso2.carbon.certificate.mgt.jaxrs.api.CertificateMgtService;
import org.wso2.carbon.certificate.mgt.jaxrs.exception.Message;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import io.entgra.device.mgt.core.certificate.mgt.api.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.api.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.certificate.mgt.api.CertificateMgtService;
import io.entgra.device.mgt.core.certificate.mgt.api.exception.Message;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.jaxrs.api.util;
package io.entgra.device.mgt.core.certificate.mgt.api.util;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -59,8 +59,8 @@
<property name="scan" value="true"/>
</bean>
<bean id="certificateServiceBean" class="org.wso2.carbon.certificate.mgt.jaxrs.api.impl.CertificateMgtServiceImpl"/>
<bean id="jsonProvider" class="org.wso2.carbon.certificate.mgt.jaxrs.api.common.GsonMessageBodyHandler"/>
<bean id="errorHandler" class="org.wso2.carbon.certificate.mgt.jaxrs.api.common.ErrorHandler"/>
<bean id="certificateServiceBean" class="io.entgra.device.mgt.core.certificate.mgt.api.impl.CertificateMgtServiceImpl"/>
<bean id="jsonProvider" class="io.entgra.device.mgt.core.certificate.mgt.api.common.GsonMessageBodyHandler"/>
<bean id="errorHandler" class="io.entgra.device.mgt.core.certificate.mgt.api.common.ErrorHandler"/>
</beans>

@ -27,7 +27,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.cert.admin.api</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.cert.admin.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - Admin Certificate Management API</name>
<description>WSO2 Carbon - Admin Certificate Management API</description>
@ -170,7 +170,7 @@
</dependency>
<dependency>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>

@ -1,4 +1,4 @@
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
@ -13,10 +13,10 @@ import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.apimgt.annotations.api.Scopes;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.CertificateList;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.EnrollmentCertificate;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.CertificateList;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.EnrollmentCertificate;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import javax.validation.constraints.Size;
import javax.ws.rs.*;

@ -16,9 +16,9 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

@ -16,9 +16,9 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.jaxrs.exception;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api;
import org.wso2.carbon.certificate.mgt.jaxrs.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;

@ -16,11 +16,11 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import java.util.ArrayList;
import java.util.List;

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.common;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.common;
/**
* Custom exception class for handling CDM API related exceptions.

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.exception;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.exception;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.swagger.extension;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.extension;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.jaxrs.Reader;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.impl;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.impl;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
@ -29,21 +29,21 @@ import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.CertificateManagementAdminService;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.CertificateList;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.EnrollmentCertificate;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ValidationResponse;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util.CertificateMgtAPIUtils;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util.RequestValidationUtil;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPException;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager;
import org.wso2.carbon.certificate.mgt.core.scep.TenantedDeviceWrapper;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.CertificateManagementAdminService;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.CertificateList;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.EnrollmentCertificate;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ValidationResponse;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util.CertificateMgtAPIUtils;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util.RequestValidationUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPException;
import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager;
import io.entgra.device.mgt.core.certificate.mgt.core.scep.TenantedDeviceWrapper;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
@ -75,12 +75,12 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
@POST
public Response addCertificate(EnrollmentCertificate[] enrollmentCertificates) {
CertificateManagementService certificateService;
List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
org.wso2.carbon.certificate.mgt.core.bean.Certificate certificate;
List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate certificate;
certificateService = CertificateMgtAPIUtils.getCertificateManagementService();
try {
for (EnrollmentCertificate enrollmentCertificate : enrollmentCertificates) {
certificate = new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
certificate = new io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate();
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificate.setSerial(enrollmentCertificate.getSerial());
certificate.setCertificate(certificateService.pemToX509Certificate(enrollmentCertificate.getPem()));

@ -16,7 +16,7 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;

@ -16,12 +16,12 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.core.search.mgt.SearchManagerService;
import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService;

@ -16,10 +16,10 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans.ErrorResponse;
import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.InputValidationException;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse;
import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.InputValidationException;
public class RequestValidationUtil {

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util;
package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -53,8 +53,8 @@
<property name="scan" value="true"/>
</bean>
<bean id="certificateServiceBean" class="org.wso2.carbon.certificate.mgt.cert.jaxrs.api.impl.CertificateManagementAdminServiceImpl"/>
<bean id="jsonProvider" class="org.wso2.carbon.certificate.mgt.cert.jaxrs.api.common.GsonMessageBodyHandler"/>
<bean id="errorHandler" class="org.wso2.carbon.certificate.mgt.cert.jaxrs.api.common.ErrorHandler"/>
<bean id="certificateServiceBean" class="io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.impl.CertificateManagementAdminServiceImpl"/>
<bean id="jsonProvider" class="io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.common.GsonMessageBodyHandler"/>
<bean id="errorHandler" class="io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.common.ErrorHandler"/>
</beans>

@ -75,7 +75,7 @@
<filter>
<filter-name>ApiOriginFilter</filter-name>
<filter-class>org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util.ApiOriginFilter</filter-class>
<filter-class>io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util.ApiOriginFilter</filter-class>
</filter>
<filter>

@ -43,7 +43,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<artifactId>io.entgra.device.mgt.core.certificate.mgt.core</artifactId>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name>
<description>WSO2 Carbon - Certificate Management Core</description>
@ -67,8 +67,8 @@
<Bundle-Version>${carbon.device.mgt.version}</Bundle-Version>
<Bundle-Description>Device Management Core Bundle</Bundle-Description>
<Private-Package>
org.wso2.carbon.certificate.mgt.core.internal,
org.wso2.carbon.certificate.mgt.core.util
io.entgra.device.mgt.core.certificate.mgt.core.internal,
io.entgra.device.mgt.core.certificate.mgt.core.util
</Private-Package>
<Import-Package>
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
@ -116,9 +116,9 @@
<!--org.bouncycastle.pkcs.jcajce-->
</Import-Package>
<Export-Package>
!org.wso2.carbon.certificate.mgt.core.internal.*,
!org.wso2.carbon.certificate.mgt.core.util,
org.wso2.carbon.certificate.mgt.core.*
!io.entgra.device.mgt.core.certificate.mgt.core.internal.*,
!io.entgra.device.mgt.core.certificate.mgt.core.util,
io.entgra.device.mgt.core.certificate.mgt.core.*
</Export-Package>
</instructions>
</configuration>

@ -17,9 +17,9 @@
*/
package org.wso2.carbon.certificate.mgt.core.cache;
package io.entgra.device.mgt.core.certificate.mgt.core.cache;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
/**
* This interface for caching the certificates.

@ -17,10 +17,10 @@
*/
package org.wso2.carbon.certificate.mgt.core.cache.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.cache.impl;
import org.wso2.carbon.certificate.mgt.core.cache.CertificateCacheManager;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.cache.CertificateCacheManager;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;

@ -16,13 +16,13 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.config;
package io.entgra.device.mgt.core.certificate.mgt.core.config;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagerUtil;
import org.w3c.dom.Document;
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagerUtil;
import org.wso2.carbon.utils.CarbonUtils;
import javax.xml.bind.JAXBContext;

@ -16,9 +16,9 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.config;
package io.entgra.device.mgt.core.certificate.mgt.core.config;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.config;
package io.entgra.device.mgt.core.certificate.mgt.core.config;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -16,9 +16,9 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.config;
package io.entgra.device.mgt.core.certificate.mgt.core.config;
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.config.datasource;
package io.entgra.device.mgt.core.certificate.mgt.core.config.datasource;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -16,11 +16,11 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao;
package io.entgra.device.mgt.core.certificate.mgt.core.dao;
import org.wso2.carbon.certificate.mgt.core.bean.Certificate;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import java.util.List;

@ -16,20 +16,20 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao;
package io.entgra.device.mgt.core.certificate.mgt.core.dao;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.GenericCertificateDAOImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.OracleCertificateDAOImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.PostgreSQLCertificateDAOImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.SQLServerCertificateDAOImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.IllegalTransactionStateException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.UnsupportedDatabaseEngineException;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.certificate.mgt.core.config.datasource.JNDILookupDefinition;
import org.wso2.carbon.certificate.mgt.core.dao.impl.GenericCertificateDAOImpl;
import org.wso2.carbon.certificate.mgt.core.dao.impl.OracleCertificateDAOImpl;
import org.wso2.carbon.certificate.mgt.core.dao.impl.PostgreSQLCertificateDAOImpl;
import org.wso2.carbon.certificate.mgt.core.dao.impl.SQLServerCertificateDAOImpl;
import org.wso2.carbon.certificate.mgt.core.exception.IllegalTransactionStateException;
import org.wso2.carbon.certificate.mgt.core.exception.TransactionManagementException;
import org.wso2.carbon.certificate.mgt.core.exception.UnsupportedDatabaseEngineException;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.JNDILookupDefinition;
import javax.sql.DataSource;
import java.sql.Connection;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao;
package io.entgra.device.mgt.core.certificate.mgt.core.dao;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -16,18 +16,18 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.bean.Certificate;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateDAO;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.core.util.Serializer;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.io.IOException;

@ -16,16 +16,16 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.sql.Connection;

@ -16,16 +16,16 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.sql.Connection;

@ -16,16 +16,16 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.sql.Connection;

@ -16,16 +16,16 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dao.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.sql.Connection;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dto;
package io.entgra.device.mgt.core.certificate.mgt.core.dto;
public enum CAStatus {

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dto;
package io.entgra.device.mgt.core.certificate.mgt.core.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.dto;
package io.entgra.device.mgt.core.certificate.mgt.core.dto;
public class SCEPResponse {

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.exception;
package io.entgra.device.mgt.core.certificate.mgt.core.exception;
public class IllegalTransactionStateException extends RuntimeException {

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.exception;
package io.entgra.device.mgt.core.certificate.mgt.core.exception;
public class KeystoreException extends Exception {

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.exception;
package io.entgra.device.mgt.core.certificate.mgt.core.exception;
public class TransactionManagementException extends Exception {

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.exception;
package io.entgra.device.mgt.core.certificate.mgt.core.exception;
/**
* This runtime exception will be thrown if the server has configured with unsupported DB engine.

@ -15,8 +15,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CommonUtil;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -55,17 +57,15 @@ import org.jscep.message.PkiMessageEncoder;
import org.jscep.transaction.FailInfo;
import org.jscep.transaction.Nonce;
import org.jscep.transaction.TransactionId;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateDAO;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dto.CAStatus;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.exception.TransactionManagementException;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.certificate.mgt.core.util.CommonUtil;
import org.wso2.carbon.certificate.mgt.core.util.Serializer;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CAStatus;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import javax.naming.InvalidNameException;
@ -220,9 +220,9 @@ public class CertificateGenerator {
certificate.verify(certificate.getPublicKey());
List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
org.wso2.carbon.certificate.mgt.core.bean.Certificate certificateToStore =
new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate certificateToStore =
new io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate();
certificateToStore.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificateToStore.setCertificate(certificate);
certificates.add(certificateToStore);
@ -537,9 +537,9 @@ public class CertificateGenerator {
issuedCert = new JcaX509CertificateConverter().setProvider(
CertificateManagementConstants.PROVIDER).getCertificate(
certificateBuilder.build(sigGen));
org.wso2.carbon.certificate.mgt.core.bean.Certificate certificate =
new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate certificate =
new io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate();
List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificate.setCertificate(issuedCert);
certificates.add(certificate);
@ -694,7 +694,7 @@ public class CertificateGenerator {
}
}
public void saveCertInKeyStore(List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificate)
public void saveCertInKeyStore(List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificate)
throws KeystoreException {
if (certificate == null) {
@ -826,9 +826,9 @@ public class CertificateGenerator {
issuedCert = (X509Certificate) certificateFactory
.generateCertificate(new ByteArrayInputStream(encodedCertificate));
org.wso2.carbon.certificate.mgt.core.bean.Certificate certificate =
new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate certificate =
new io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate();
List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
certificate.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificate.setCertificate(issuedCert);
certificates.add(certificate);

@ -15,21 +15,21 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.cache.CertificateCacheManager;
import org.wso2.carbon.certificate.mgt.core.cache.impl.CertificateCacheManagerImpl;
import org.wso2.carbon.certificate.mgt.core.config.CertificateConfigurationManager;
import org.wso2.carbon.certificate.mgt.core.config.CertificateKeystoreConfig;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateDAO;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.util.Serializer;
import io.entgra.device.mgt.core.certificate.mgt.core.cache.CertificateCacheManager;
import io.entgra.device.mgt.core.certificate.mgt.core.cache.impl.CertificateCacheManagerImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager;
import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateKeystoreConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

@ -16,23 +16,23 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.internal;
package io.entgra.device.mgt.core.certificate.mgt.core.internal;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager;
import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManagerImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateMgtSchemaInitializer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.certificate.mgt.core.config.CertificateConfigurationManager;
import org.wso2.carbon.certificate.mgt.core.config.CertificateManagementConfig;
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager;
import org.wso2.carbon.certificate.mgt.core.scep.SCEPManagerImpl;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.certificate.mgt.core.util.CertificateMgtSchemaInitializer;
import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager;
import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateManagementConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
/**

@ -33,7 +33,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.scep;
package io.entgra.device.mgt.core.certificate.mgt.core.scep;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;

@ -33,12 +33,12 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.scep;
package io.entgra.device.mgt.core.certificate.mgt.core.scep;
import org.apache.commons.collections.map.SingletonMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.internal.CertificateManagementDataHolder;
import io.entgra.device.mgt.core.certificate.mgt.core.internal.CertificateManagementDataHolder;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.scep;
package io.entgra.device.mgt.core.certificate.mgt.core.scep;
import org.wso2.carbon.device.mgt.common.Device;

@ -15,13 +15,13 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.service;
package io.entgra.device.mgt.core.certificate.mgt.core.service;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import java.io.InputStream;
import java.security.PrivateKey;
@ -64,7 +64,7 @@ public interface CertificateManagementService {
CertificateResponse getCertificateBySerial(String serial) throws KeystoreException;
void saveCertificate(List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificate)
void saveCertificate(List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificate)
throws KeystoreException;
X509Certificate pemToX509Certificate(String pem) throws KeystoreException;

@ -15,23 +15,23 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.service;
package io.entgra.device.mgt.core.certificate.mgt.core.service;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator;
import io.entgra.device.mgt.core.certificate.mgt.core.impl.KeyStoreReader;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagerUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateDAO;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOException;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.exception.TransactionManagementException;
import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator;
import org.wso2.carbon.certificate.mgt.core.impl.KeyStoreReader;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagerUtil;
import java.io.InputStream;
import java.security.PrivateKey;
@ -126,7 +126,7 @@ public class CertificateManagementServiceImpl implements CertificateManagementSe
return keyStoreReader.getCertificateBySerial(serial);
}
public void saveCertificate(List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificate)
public void saveCertificate(List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificate)
throws KeystoreException {
certificateGenerator.saveCertInKeyStore(certificate);
}

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.service;
package io.entgra.device.mgt.core.certificate.mgt.core.service;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ -17,17 +17,17 @@
*/
package org.wso2.carbon.certificate.mgt.core.util;
package io.entgra.device.mgt.core.certificate.mgt.core.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.w3c.dom.Document;
import org.wso2.carbon.certificate.mgt.core.config.CertificateConfigurationManager;
import org.wso2.carbon.certificate.mgt.core.config.CertificateManagementConfig;
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.certificate.mgt.core.config.datasource.JNDILookupDefinition;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager;
import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateManagementConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.JNDILookupDefinition;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import javax.sql.DataSource;
import javax.xml.XMLConstants;

@ -16,11 +16,11 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.util;
package io.entgra.device.mgt.core.certificate.mgt.core.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.certificate.mgt.core.config.datasource.DataSourceConfig;
import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig;
import org.wso2.carbon.utils.CarbonUtils;
import org.wso2.carbon.utils.dbcreator.DatabaseCreator;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.util;
package io.entgra.device.mgt.core.certificate.mgt.core.util;
import java.math.BigInteger;
import java.util.Calendar;

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.util;
package io.entgra.device.mgt.core.certificate.mgt.core.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

@ -16,8 +16,9 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.common;
package io.entgra.device.mgt.core.certificate.mgt.core.common;
import io.entgra.device.mgt.core.certificate.mgt.core.util.TestUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tomcat.jdbc.pool.PoolProperties;
@ -25,7 +26,6 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;
import org.w3c.dom.Document;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.certificate.mgt.core.util.TestUtils;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.common;
package io.entgra.device.mgt.core.certificate.mgt.core.common;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@ -16,13 +16,13 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.wso2.carbon.certificate.mgt.core.cache.CertificateCacheManager;
import org.wso2.carbon.certificate.mgt.core.common.BaseDeviceManagementCertificateTest;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.cache.CertificateCacheManager;
import io.entgra.device.mgt.core.certificate.mgt.core.common.BaseDeviceManagementCertificateTest;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
/**
* This class tests CertificateCache manager methods
@ -36,7 +36,7 @@ public class CertificateCacheManagerImplTests extends BaseDeviceManagementCertif
public void init() throws Exception {
initDataSource();
CertificateManagementDAOFactory.init(this.getDataSource());
manager = org.wso2.carbon.certificate.mgt.core.cache.impl.CertificateCacheManagerImpl.getInstance();
manager = io.entgra.device.mgt.core.certificate.mgt.core.cache.impl.CertificateCacheManagerImpl.getInstance();
Assert.assertNotNull(manager);
}

@ -16,7 +16,8 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CSRGenerator;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.cert.CertIOException;
@ -35,10 +36,9 @@ import org.powermock.modules.testng.PowerMockTestCase;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.util.CSRGenerator;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import javax.sql.DataSource;
import java.io.File;

@ -1,12 +1,12 @@
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import java.io.File;
import java.io.IOException;

@ -16,13 +16,13 @@
* under the License.
*
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import junit.framework.Assert;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.testng.annotations.Test;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
public class CertificateGeneratorTests {

@ -16,7 +16,7 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
import org.mockito.Mockito;
@ -29,10 +29,10 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.ObjectFactory;
import org.testng.annotations.Test;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.exception.TransactionManagementException;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import javax.sql.DataSource;

@ -16,8 +16,10 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CSRGenerator;
import io.entgra.device.mgt.core.certificate.mgt.core.util.DummyCertificate;
import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -30,18 +32,16 @@ import org.bouncycastle.pkcs.PKCS10CertificationRequest;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.certificate.mgt.core.common.BaseDeviceManagementCertificateTest;
import org.wso2.carbon.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import org.wso2.carbon.certificate.mgt.core.dto.CAStatus;
import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse;
import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse;
import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException;
import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException;
import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementServiceImpl;
import org.wso2.carbon.certificate.mgt.core.service.PaginationResult;
import org.wso2.carbon.certificate.mgt.core.util.CSRGenerator;
import org.wso2.carbon.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.certificate.mgt.core.util.DummyCertificate;
import io.entgra.device.mgt.core.certificate.mgt.core.common.BaseDeviceManagementCertificateTest;
import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CAStatus;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException;
import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException;
import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl;
import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult;
import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
@ -288,9 +288,9 @@ public class CertificateManagementServiceImplTests extends BaseDeviceManagementC
byte[] caBytes = FileUtils.readFileToByteArray(caCert);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(caBytes));
List<org.wso2.carbon.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
org.wso2.carbon.certificate.mgt.core.bean.Certificate certificateToStore =
new org.wso2.carbon.certificate.mgt.core.bean.Certificate();
List<io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate> certificates = new ArrayList<>();
io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate certificateToStore =
new io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate();
certificateToStore.setTenantId(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
certificateToStore.setCertificate(cert);
certificates.add(certificateToStore);

@ -16,12 +16,12 @@
* under the License.
*/
package org.wso2.carbon.certificate.mgt.core.impl;
package io.entgra.device.mgt.core.certificate.mgt.core.impl;
import io.entgra.device.mgt.core.certificate.mgt.core.util.DummyCertificate;
import org.testng.Assert;
import org.testng.annotations.Test;
import org.wso2.carbon.certificate.mgt.core.bean.Certificate;
import org.wso2.carbon.certificate.mgt.core.util.DummyCertificate;
import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate;
/**
* This class tests the DTO for certificates

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save