Service to support nonrepudiation of origin in the CPF
This repository contains a docker-compose.yaml that runs:
- NRO Service (
cpf-nro-service) - PostgreSQL for Trusted Party (
cpf-nro-postgres)
- Docker Engine + Docker Compose installed on the machine where you run the stack. Follow this instructions.
git clone git@github.com:Common-Provenance-Framework/NRO-Service.gitRun commands from the NRO-Service root directory.
mkdir -p certs/trusted
mkdir -p certs/service
openssl ecparam -name prime256v1 -genkey -noout -out ./certs/ca.key
openssl req -x509 -new -key ./certs/ca.key -sha256 -days 3650 \
-subj "/C=CZ/O=CPF/CN=cpf-root-ca" \
-out ./certs/trusted/ca.pem
cat > certs/service/v3_nro.ext <<'EOF'
basicConstraints=critical,CA:FALSE
keyUsage=critical,digitalSignature
extendedKeyUsage=clientAuth
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer
EOF
openssl ecparam -name prime256v1 -genkey -noout -out ./certs/service/nro.key
openssl req -new -key ./certs/service/nro.key \
-subj "/C=CZ/O=CPF/CN=NRO-Service" \
-out ./certs/service/nro.csr
openssl x509 -req -in ./certs/service/nro.csr \
-CA ./certs/trusted/ca.pem -CAkey ./certs/ca.key -CAcreateserial \
-out ./certs/service/nro.pem -days 825 -sha256 \
-extfile certs/service/v3_nro.ext
Optional sanity checks:
openssl x509 -in ./certs/service/nro.pem -noout -subject -issuer
openssl x509 -in ./certs/service/nro.pem -noout -text | grep "Public Key Algorithm"
openssl verify -CAfile ./certs/trusted/ca.pem ./certs/service/nro.pem
Cleanup temporary files (CSRs, extension configs, serial files):
rm -f ./certs/service/nro.csr \
./certs/service/v3_nro.ext \
./certs/trusted/ca.srl
Once yors certificates are ready, run this command from the NRO-Service root directory.
docker compose up --build --detachdocker ps
curl http://localhost:8082/api/v1/info
docker logs -f cpf-nro-servicedocker compose downIf You want to remove all data volumes (PostgreSQL)
docker compose down -v