This Laravel application provides an API endpoint for verifying certificates. The verification process checks the validity of the recipient, issuer, and certificate signature using a VerificationService. The application also includes a JsonContentValidator to validate JSON input data.
-
Clone the repository:
git clone https://github.com/username/certificate-verification-api.git cd certificate-verification-api -
Install dependencies:
composer install
-
Create a copy of the
.envfile:cp .env.example .env
-
Generate an application key:
php artisan key:generate
-
Configure your database and other environment variables in the
.envfile f needs. -
Run the database migrations:
php artisan migrate
-
Start the development server:
php artisan serve
The application should now be running on
http://localhost:8000.
POST /api/verify
This endpoint accepts a JSON file request containing certificate data and validates it. The certificate's recipient, issuer, and signature are verified.
json_file
To use the /api/verify endpoint with a JSON file, follow these steps:
- In the root folder we have certificate.json file
-
Use
curlto send the request with the JSON file:curl -X POST http://localhost:8000/api/verify \ -H "Content-Type: application/json" \ -d @certificate.json -
Response Example:
{
"data": {
"issuer": "Accredify",
"result": "invalid_issuer"
}
}GET /api/history
GET /api/documentation
To run the tests, use the following command:
php artisan test