Modified to support certificate generation