https://github.com/milahu/nssdb-py
add a ca.crt certificate to $HOME/.pki/nssdb/cert9.db and $HOME/.pki/nssdb/key4.db in python
https://github.com/milahu/nssdb-py
certificates certutil https nss nssdb ssl tls
Last synced: 10 months ago
JSON representation
add a ca.crt certificate to $HOME/.pki/nssdb/cert9.db and $HOME/.pki/nssdb/key4.db in python
- Host: GitHub
- URL: https://github.com/milahu/nssdb-py
- Owner: milahu
- License: mit
- Created: 2023-12-05T13:01:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-05T18:43:03.000Z (about 2 years ago)
- Last Synced: 2025-02-06T09:38:38.987Z (11 months ago)
- Topics: certificates, certutil, https, nss, nssdb, ssl, tls
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# nssdb-py
add a `ca.crt` certificate to `$HOME/.pki/nssdb/cert9.db` and `$HOME/.pki/nssdb/key4.db` in python
implement this part of certutil in python:
```
certutil -d sql:$HOME/.pki/nssdb -A -t TC -n "Some Authority" -i ca.crt
```
## related
- https://github.com/nss-dev/nss
- https://github.com/nss-dev/nss/blob/master/lib/softoken/sdb.c
- `sdb_init(cert, "nssPublic"`
- https://www.dogtagpki.org/wiki/Support_NSSDB_in_Python_API
- draft
- https://github.com/drGrove/mtls-cli/blob/main/src/mtls/mtls.py
- using `certutil`
### parse SSL certificates in python
aka: X.509 certificates
- https://stackoverflow.com/questions/16899247/how-can-i-decode-a-ssl-certificate-using-python
- https://stackoverflow.com/a/68060835/10440128
- `import ssl; ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT); ctx.load_verify_locations("ca.crt"); cert = ctx.get_ca_certs()`
- https://cryptography.io/en/latest/x509/reference/#loading-certificates