Merge pull request #328 from madhawap/master

changes to Certificate removal endpoint, fix for the jira EMM-1490
merge-requests/7/head
Dilan U. Ariyaratne 8 years ago committed by GitHub
commit 1641403f82

@ -122,11 +122,14 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
try { try {
boolean status = certificateService.removeCertificate(serialNumber); boolean status = certificateService.removeCertificate(serialNumber);
if (!status) { if (!status) {
Response.status(Response.Status.NOT_FOUND).entity("No certificate is found with the given " + return Response.status(Response.Status.NOT_FOUND).entity(
"serial number '" + serialNumber + "'"); "No certificate is found with the given " +
"serial number '" + serialNumber + "'").build();
} else {
return Response.status(Response.Status.OK).entity(
"Certificate that carries the serial number '" +
serialNumber + "' has been removed").build();
} }
return Response.status(Response.Status.OK).entity("Certificate that carries the serial number '" +
serialNumber + "' has been removed").build();
} catch (CertificateManagementException e) { } catch (CertificateManagementException e) {
String msg = "Error occurred while converting PEM file to X509Certificate"; String msg = "Error occurred while converting PEM file to X509Certificate";
log.error(msg, e); log.error(msg, e);
@ -136,3 +139,6 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem
} }
} }
//return Response.status(Response.Status.NOT_FOUND).entity("No certificate is found with the given " +
// "serial number '" + serialNumber + "'");
Loading…
Cancel
Save