Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rsatrio/softhsm2-rest

REST API for SoftHSM2
https://github.com/rsatrio/softhsm2-rest

Last synced: 10 days ago
JSON representation

REST API for SoftHSM2

Awesome Lists containing this project

README

        

# SoftHSM2 REST API

A simple REST API for SoftHSM2. This project is build with dropwizard 2.x,Java 8, SoftHSM2, and Docker.

## Features

- REST Endpoint
- Swagger page to test the API
- Create RSA Key on Initialized Slot at SoftHSM2
- Signing Base64 data with Key stored in SoftHSM2. Signing Mechanism is using SHA256withRSA
- Retrieve RSA Public Key from HSM
- Dockerized

## Build

- Run docker build
```shell
docker build -t softhsm-rest .
```
- Run the docker image from previous step:
```shell
docker run -p 9080:9080 softhsm-rest
```
- Take note of the Slot ID created and User PIN (check Dockerfile, it should be 1234567)

- Go to the swagger page (http://localhost:9080/swagger), and test creating key in the SlotID (or just enter 0) created before. Use the /v1/softhsm/create-key endpoint
- If key successfully created, then try to sign Base64 data with that key. For convenience, you can use the swagger interface earlier. Use the /v1/softhsm/sign-data endpoint

## Feedback

For feedback, please raise issues in the issue section of the repository. Periodically, I will update the example with more real-life use case example. Enjoy!!.