2020-11-22 10:28:28 +00:00
|
|
|
# Browser PKCS#10 CSR generation PoC
|
|
|
|
|
|
|
|
This repository contains a small proof of concept implementation of browser
|
|
|
|
based PKCS#10 certificate signing request and PKCS#12 key store generation
|
|
|
|
using [node-forge](https://github.com/digitalbazaar/forge).
|
|
|
|
|
2020-11-29 23:55:34 +00:00
|
|
|
The backend is implemented in [Go](https://golang.org/) and utilizes openssl
|
|
|
|
for the signing operations.
|
|
|
|
|
2020-11-22 10:28:28 +00:00
|
|
|
## Running
|
|
|
|
|
|
|
|
1. Clone the repository
|
|
|
|
|
|
|
|
```
|
|
|
|
git clone https://git.dittberner.info/jan/browser_csr_generation.git
|
|
|
|
```
|
|
|
|
|
|
|
|
2. Get dependencies and build assets
|
|
|
|
|
|
|
|
```
|
|
|
|
cd browser_csr_generation
|
|
|
|
npm install --global gulp-cli
|
|
|
|
npm install
|
|
|
|
gulp
|
|
|
|
```
|
|
|
|
|
2020-11-29 23:55:34 +00:00
|
|
|
2. Setup the example CA and a server certificate and key
|
|
|
|
|
|
|
|
```
|
|
|
|
./setup_example_ca.sh
|
|
|
|
openssl req -new -x509 -days 365 -subj "/CN=localhost" -addext subjectAltName=DNS:localhost -newkey rsa:3072 \
|
|
|
|
-nodes -out server.crt.pem -keyout server.key.pem
|
|
|
|
```
|
|
|
|
|
|
|
|
3. Run the Go based backend
|
2020-11-22 10:28:28 +00:00
|
|
|
|
|
|
|
```
|
2020-11-29 23:55:34 +00:00
|
|
|
go run main.go
|
2020-11-22 10:28:28 +00:00
|
|
|
```
|
|
|
|
|
2020-11-29 23:55:34 +00:00
|
|
|
Open https://localhost:8000/ in your browser.
|
2020-11-22 10:28:28 +00:00
|
|
|
|
|
|
|
4. Run gulp watch
|
|
|
|
|
|
|
|
You can run a [gulp watch](https://gulpjs.com/docs/en/getting-started/watching-files/)
|
|
|
|
in a second terminal window to automatically publish changes to the files
|
|
|
|
in the `src` directory:
|
|
|
|
|
|
|
|
```
|
|
|
|
gulp watch
|
|
|
|
```
|