2023-05-19 17:30:30 +00:00
|
|
|
# Browser based client certificate creation
|
2020-11-22 10:28:28 +00:00
|
|
|
|
2023-05-19 17:30:30 +00:00
|
|
|
This repository contains an implementation to create a client certificate key store in a modern Web browser.
|
2020-11-22 10:28:28 +00:00
|
|
|
|
2023-05-19 17:30:30 +00:00
|
|
|
The implementation uses the excellent [node-forge](https://github.com/digitalbazaar/forge) library.
|
|
|
|
|
|
|
|
[Bootstrap 5](https://getbootstrap.com/docs/5.2/) is used for styling the user interface.
|
|
|
|
|
|
|
|
This is meant as a replacement for the `<keygen>` tag that has been removed from browsers.
|
|
|
|
|
|
|
|
The following steps have been implemented:
|
|
|
|
|
|
|
|
- choose a common name for the subject of the certificate signing request
|
|
|
|
- generate an RSA key pair with a selectable size
|
|
|
|
- generate a certificate signing request (PKCS#10 CSR)
|
|
|
|
- paste the certificate signed by the certificate authority
|
|
|
|
- build a PKCS#12 (also known as .p12 or .pfx) key store file with a password chosen by the user. That file contains the
|
|
|
|
generated key pair, the client certificate, and the CA certificate chain
|
|
|
|
|
|
|
|
The implementation contains the [CAcert CA certificates](https://secure.cacert.org/index.php?id=3) for CA chain
|
|
|
|
building.
|
2020-11-29 23:55:34 +00:00
|
|
|
|
2020-11-22 10:28:28 +00:00
|
|
|
## Running
|
|
|
|
|
2022-04-24 17:19:51 +00:00
|
|
|
1. Install dependencies
|
|
|
|
|
2023-05-19 17:30:30 +00:00
|
|
|
```shell
|
|
|
|
sudo apt install git npm
|
2022-04-24 17:19:51 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
2. Clone the repository
|
2020-11-22 10:28:28 +00:00
|
|
|
|
2023-05-19 17:30:30 +00:00
|
|
|
```shell
|
|
|
|
git clone https://code.cacert.org/cacert/browser-csr-generation.git
|
2020-11-22 10:28:28 +00:00
|
|
|
```
|
|
|
|
|
2022-04-24 17:19:51 +00:00
|
|
|
3. Get dependencies and build assets
|
2020-11-22 10:28:28 +00:00
|
|
|
|
2023-05-19 17:30:30 +00:00
|
|
|
```shell
|
|
|
|
cd browser-csr-generation
|
2022-11-20 07:54:16 +00:00
|
|
|
npm install --no-save --user gulp-cli
|
2020-11-22 10:28:28 +00:00
|
|
|
npm install
|
2022-11-20 07:54:16 +00:00
|
|
|
npm run build
|
2020-11-22 10:28:28 +00:00
|
|
|
```
|
|
|
|
|
2023-05-19 17:30:30 +00:00
|
|
|
4. Open `public/index.html` in a Web browser
|
|
|
|
5. Run
|
2020-11-22 10:28:28 +00:00
|
|
|
```
|
2022-11-20 07:54:16 +00:00
|
|
|
npm run watch
|
2020-11-22 10:28:28 +00:00
|
|
|
```
|
2023-05-19 17:30:30 +00:00
|
|
|
to continuously update the `public/index.html` when changing `src/index.html`
|