     return
 
   certData = this.request.body
+  certData['dateRevoked'] = new Date()
 
   try
     cert_entry = new RevokedCert certData
     result = yield Q.ninvoke cert_entry, 'save'
-    
+
     logger.info "User #{this.authenticated.email} added a new entry in the revocation list with for cert with serial: #{result["serial"]};issuer: #{result["issuerDN"]}"
     this.body = 'Successfully added in the Revocation list'
     this.status = 201



exports.removeRevokedCert = () ->
#must accept {serial,issuer} 
  # Test if the user is authorised
  if not authorisation.inGroup 'admin', this.authenticated
    utils.logAndSetResponse this, 403, "User #{this.authenticated.email} is not an admin, API access to removeRevokedCert.", 'info'

  try
    this.body = yield RevokedCert.find().exec()
    #this.body = revokedcertDoc

  catch err
    utils.logAndSetResponse this, 500, "Could not fetch the list of revoked certificates: #{err}", 'error'

