mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request 'set device identifire for certificate table' (#278) from nishan/device-mgt-core:identifire#10145 into master
Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/278
This commit is contained in:
commit
07c238f97f
@ -53,8 +53,8 @@ public abstract class AbstractCertificateDAOImpl implements CertificateDAO{
|
||||
try {
|
||||
conn = this.getConnection();
|
||||
stmt = conn.prepareStatement(
|
||||
"INSERT INTO DM_DEVICE_CERTIFICATE (SERIAL_NUMBER, CERTIFICATE, TENANT_ID, USERNAME)"
|
||||
+ " VALUES (?,?,?,?)");
|
||||
"INSERT INTO DM_DEVICE_CERTIFICATE (SERIAL_NUMBER, CERTIFICATE, TENANT_ID, USERNAME, DEVICE_IDENTIFIER)"
|
||||
+ " VALUES (?,?,?,?,?)");
|
||||
PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.
|
||||
getThreadLocalCarbonContext();
|
||||
String username = threadLocalCarbonContext.getUsername();
|
||||
@ -70,6 +70,7 @@ public abstract class AbstractCertificateDAOImpl implements CertificateDAO{
|
||||
stmt.setBytes(2, bytes);
|
||||
stmt.setInt(3, certificate.getTenantId());
|
||||
stmt.setString(4, username);
|
||||
stmt.setString(5, certificate.getDeviceIdentifier());
|
||||
stmt.addBatch();
|
||||
}
|
||||
stmt.executeBatch();
|
||||
|
||||
@ -871,6 +871,7 @@ public class CertificateGenerator {
|
||||
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(tenantId);
|
||||
certificate.setDeviceIdentifier(commonName);
|
||||
certificate.setCertificate(issuedCert);
|
||||
certificates.add(certificate);
|
||||
saveCertInKeyStore(certificates);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user