lupaxa-certtool 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,206 @@
1
+ ###############################################################################
2
+ # LUPAXA STANDARD .gitignore
3
+ # Sensible defaults for Python + tooling + docs, without being over the top.
4
+ ###############################################################################
5
+
6
+ ###############################################################################
7
+ # Python bytecode / cache
8
+ ###############################################################################
9
+ __pycache__/
10
+ *.py[cod]
11
+ *.pyo
12
+ *.pyd
13
+ *.so
14
+
15
+ ###############################################################################
16
+ # Build & packaging outputs
17
+ ###############################################################################
18
+ build/
19
+ dist/
20
+ wheelhouse/
21
+ *.egg-info/
22
+ *.egg
23
+ *.whl
24
+ pip-wheel-metadata/
25
+ .eggs/
26
+
27
+ ###############################################################################
28
+ # Virtual environments
29
+ ###############################################################################
30
+ venv/
31
+ .env/
32
+ .venv/
33
+ env/
34
+ ENV/
35
+ .conda/
36
+ .python-version # pyenv / asdf local version file
37
+
38
+ ###############################################################################
39
+ # Hatch, Poetry, Pipenv, PDM, Rye, etc.
40
+ ###############################################################################
41
+ .hatch/
42
+ .poetry/
43
+ pipenv-files/
44
+ pdm.lock
45
+ pdm.toml
46
+ rye.lock
47
+
48
+ ###############################################################################
49
+ # Secrets, credentials, tokens, auth files
50
+ ###############################################################################
51
+ # Keep this focused so we don’t explode on every directory name.
52
+ *.env
53
+ *.env.*
54
+ .envrc
55
+ *.secret
56
+ *.secrets
57
+ *.credentials
58
+ *.tokens
59
+ vault.json
60
+ *.gpg
61
+ *.asc
62
+ *.pgp
63
+
64
+ ###############################################################################
65
+ # Certificate / key outputs (runtime artefacts, not source)
66
+ ###############################################################################
67
+ *.pem
68
+ *.der
69
+ *.csr
70
+ *.key
71
+ *.crt
72
+ *.pfx
73
+ *.cer
74
+ *.jwk
75
+ *.keystore
76
+
77
+ # Common output dirs for generated certs/keys
78
+ certs*/
79
+ keys*/
80
+ output*/
81
+ generated*/
82
+
83
+ ###############################################################################
84
+ # Logs, dumps, traces
85
+ ###############################################################################
86
+ *.log
87
+ *.audit
88
+ *.trace
89
+ *.out
90
+ *.err
91
+ *.dump
92
+ *.stackdump
93
+ *.core
94
+ core.*
95
+
96
+ ###############################################################################
97
+ # Test artefacts and temporary test outputs
98
+ ###############################################################################
99
+ tests/tmp*/
100
+ tests/output*/
101
+ tests/**/assets*/
102
+ coverage.xml
103
+ htmlcov/
104
+ .coverage*
105
+ .nox/
106
+ .tox/
107
+
108
+ ###############################################################################
109
+ # Tooling caches: Ruff, mypy, pytest, pip, coverage, etc.
110
+ ###############################################################################
111
+ .ruff_cache/
112
+ .mypy_cache/
113
+ .pytest_cache/
114
+ .cache/
115
+ pytestdebug.log
116
+ pip-log.txt
117
+
118
+ # Temporary audit venv used by Makefile
119
+ .audit-env/
120
+
121
+ ###############################################################################
122
+ # Documentation — MkDocs, Sphinx, etc.
123
+ ###############################################################################
124
+ # MkDocs static site output
125
+ site/
126
+
127
+ # Other doc build outputs
128
+ docs/_build/
129
+ docs/build/
130
+ docs/.cache/
131
+ docs/.benchmarks/
132
+
133
+ ###############################################################################
134
+ # IDE Junk: VSCode, JetBrains, Sublime, etc.
135
+ ###############################################################################
136
+ # VS Code
137
+ .vscode/
138
+ !.vscode/settings.json
139
+ !.vscode/extensions.json
140
+
141
+ # JetBrains
142
+ .idea/
143
+ *.iml
144
+
145
+ # Sublime
146
+ *.sublime-project
147
+ *.sublime-workspace
148
+
149
+ # Other editors
150
+ *.swp
151
+ *.swo
152
+
153
+ ###############################################################################
154
+ # OS Junk
155
+ ###############################################################################
156
+ # macOS
157
+ .DS_Store
158
+ .AppleDouble
159
+ .LSOverride
160
+ Icon?
161
+ ._*
162
+
163
+ # Windows
164
+ Thumbs.db
165
+ ehthumbs.db
166
+ Desktop.ini
167
+ $RECYCLE.BIN/
168
+
169
+ ###############################################################################
170
+ # Temporary & generated files
171
+ ###############################################################################
172
+ tmp/
173
+ temp/
174
+ *.tmp
175
+ *.temp
176
+ *.bak
177
+ *.backup
178
+ *.orig
179
+ *.old
180
+
181
+ # Editors
182
+ *~
183
+ *.autosave
184
+
185
+ ###############################################################################
186
+ # Local-only configuration files
187
+ ###############################################################################
188
+ *.local
189
+ *.override
190
+ *.user
191
+ *.machine
192
+ config.local.*
193
+ settings.local.*
194
+
195
+ ###############################################################################
196
+ # Docker containers, images, volumes
197
+ ###############################################################################
198
+ docker/
199
+ docker-compose.override.yml
200
+
201
+ ###############################################################################
202
+ # Git metadata overrides
203
+ ###############################################################################
204
+ git-*.sh
205
+ *.diff
206
+ *.patch
File without changes
@@ -0,0 +1,272 @@
1
+ Metadata-Version: 2.4
2
+ Name: lupaxa-certtool
3
+ Version: 0.1.0
4
+ Summary: A Python toolkit and CLI for generating self-signed certificates, CSRs, and private keys.
5
+ Project-URL: Homepage, https://github.com/lupaxa-security-toolbox/certtool
6
+ Project-URL: Documentation, https://lupaxa-security-toolbox.github.io/certtool/
7
+ Project-URL: Repository, https://github.com/lupaxa-security-toolbox/certtool
8
+ Project-URL: Issues, https://github.com/lupaxa-security-toolbox/certtool/issues
9
+ Author: The Lupaxa Project
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: automation,certificate,cryptography,csr,ssl,x509
13
+ Classifier: Environment :: Console
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Security :: Cryptography
22
+ Classifier: Topic :: Utilities
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: cryptography>=43.0.0
25
+ Provides-Extra: dev
26
+ Requires-Dist: bump-my-version>=1.2.0; extra == 'dev'
27
+ Requires-Dist: mkdocs-material>=9.5.0; extra == 'dev'
28
+ Requires-Dist: mkdocs>=1.6.0; extra == 'dev'
29
+ Requires-Dist: mypy>=1.12.0; extra == 'dev'
30
+ Requires-Dist: pip-audit>=2.7.0; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=5.0; extra == 'dev'
32
+ Requires-Dist: pytest>=8.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.6.0; extra == 'dev'
34
+ Requires-Dist: types-setuptools; extra == 'dev'
35
+ Provides-Extra: test
36
+ Requires-Dist: pytest-cov>=5.0; extra == 'test'
37
+ Requires-Dist: pytest>=8.0; extra == 'test'
38
+ Description-Content-Type: text/markdown
39
+
40
+ <!-- markdownlint-disable -->
41
+ <p align="center">
42
+ <a href="https://github.com/lupaxa-security-toolbox">
43
+ <img src="https://raw.githubusercontent.com/the-lupaxa-project/org-logos/master/orgs/security-toolbox/readme-logo.png" alt="Project Logo" width="256"/><br/>
44
+ </a>
45
+ The Lupaxa Security Toolbox.<br />
46
+ Part of The Lupaxa Project.
47
+ </p>
48
+
49
+ # lupaxa-certtool
50
+
51
+ A clean, modern, fully-typed Python CLI and library for generating **self-signed X.509 certificates**, **certificate signing requests (CSRs)**, and **private keys**.
52
+
53
+ Built for automation, reproducibility, and bulk-generation workflows used by The Lupaxa Project.
54
+
55
+ ## Features
56
+
57
+ - Generate **self-signed certificates**, **private keys**, and **CSRs**
58
+ - Generate from:
59
+ - **JSON config file**
60
+ - **Directory of config files** (bulk mode)
61
+ - **Pure command-line flags**
62
+ - Output:
63
+ - To **stdout**
64
+ - Or into an **output directory**, with one folder per certificate
65
+ - Supports:
66
+ - RSA key generation
67
+ - SHA-256 / SHA-384 / SHA-512 digests
68
+ - Validity period configuration
69
+ - Optional **private key encryption** with passphrase
70
+ - **Subject Alternative Names (SANs)** via JSON or CLI
71
+ - Includes:
72
+ - `--generate-example` to produce a full example JSON config
73
+ - `--inspect-cert` to analyze existing PEM certificates
74
+ - `--validate-config` to validate config files before use
75
+ - Fully typed, linted, formatted, and tested
76
+ - MkDocs documentation included
77
+
78
+ ## Installation
79
+
80
+ ### From PyPI
81
+
82
+ ```bash
83
+ pip install lupaxa-certtool
84
+ ```
85
+
86
+ ### From source (development mode)
87
+
88
+ ```bash
89
+ pip install -e ".[dev]"
90
+ ```
91
+
92
+ ## Usage
93
+
94
+ ### Basic self-signed certificate from CLI
95
+
96
+ ```bash
97
+ certtool \
98
+ --countryName UK \
99
+ --stateOrProvinceName Somerset \
100
+ --localityName Glastonbury \
101
+ --organizationName "Lupaxa Project" \
102
+ --commonName "example.local"
103
+ ```
104
+
105
+ ## Using JSON Configuration
106
+
107
+ ### Generate an example config
108
+
109
+ ```bash
110
+ certtool --generate-example --example-file example-cert.json
111
+ ```
112
+
113
+ ### Use a JSON config file
114
+
115
+ ```bash
116
+ certtool --config example-cert.json
117
+ ```
118
+
119
+ ### Use a directory of configs (bulk mode)
120
+
121
+ ```bash
122
+ certtool --config-dir configs/
123
+ ```
124
+
125
+ ## Output Directory Structure
126
+
127
+ If you pass:
128
+
129
+ ```bash
130
+ certtool --config-dir configs/ --output-dir output/
131
+ ```
132
+
133
+ You get:
134
+
135
+ ```bash
136
+ output/
137
+ ├── example.local/
138
+ │ ├── cert.pem
139
+ │ ├── csr.pem
140
+ │ └── key.pem
141
+ └── api.internal/
142
+ ├── cert.pem
143
+ ├── csr.pem
144
+ └── key.pem
145
+ ```
146
+
147
+ Each certificate gets its own folder to prevent overwriting.
148
+
149
+ ## Private Key Encryption
150
+
151
+ ### JSON
152
+
153
+ ```bash
154
+ {
155
+ "passphrase": "your-secret-here"
156
+ }
157
+ ```
158
+
159
+ ### CLI (overrides JSON)
160
+
161
+ ```bash
162
+ certtool --config server.json --passphrase "some-secret"
163
+ ```
164
+
165
+ ## Inspect a Certificate
166
+
167
+ ```bash
168
+ certtool --inspect-cert output/example.local/cert.pem
169
+ ```
170
+
171
+ ## Development
172
+
173
+ ### Run tests
174
+
175
+ ```bash
176
+ make test
177
+ ```
178
+
179
+ ### Type checking
180
+
181
+ ```bash
182
+ make type
183
+ ```
184
+
185
+ ### Lint, format, and style checks
186
+
187
+ ```bash
188
+ make check-style
189
+ ```
190
+
191
+ ### Run everything
192
+
193
+ ```bash
194
+ make check-all
195
+ ```
196
+
197
+ ### Build documentation
198
+
199
+ ```bash
200
+ mkdocs serve
201
+ ```
202
+
203
+ ## Documentation
204
+
205
+ The project includes MkDocs documentation.
206
+
207
+ ### Online documentation:
208
+
209
+ [Documentation](https://lupaxa-security-toolbox.github.io/certtool/)
210
+
211
+ Full documentation is available in the docs/ directory or served locally:
212
+
213
+ ### Serve docs locally
214
+
215
+ ```bash
216
+ mkdocs serve
217
+ ```
218
+
219
+ Then open the printed URL (usually http://127.0.0.1:8000/) in your browser.
220
+
221
+ ## Development
222
+
223
+ Clone the repository and install dev dependencies:
224
+
225
+ ```bash
226
+ pip install -e ".[dev]"
227
+ ```
228
+
229
+ Useful make targets:
230
+
231
+ ```bash
232
+ make test # run tests
233
+ make type # type checking (mypy)
234
+ make check-style # lint + format + type
235
+ make check-all # run tests, coverage, and audit
236
+ ```
237
+
238
+ ## Repository Layout
239
+
240
+ ```bash
241
+ lupaxa-certtool/
242
+ ├── src/lupaxa/certtool/
243
+ │ ├── cli.py
244
+ │ ├── certs.py
245
+ │ ├── utils.py
246
+ │ ├── config.py
247
+ │ ├── example.py
248
+ │ ├── exceptions.py
249
+ │ ├── version.py
250
+ │ └── __init__.py
251
+ ├── docs/
252
+ ├── tests/
253
+ ├── mkdocs.yml
254
+ ├── Makefile
255
+ ├── pyproject.toml
256
+ ├── .editorconfig
257
+ ├── .gitignore
258
+ └── README.md
259
+ ```
260
+ <h1></h1>
261
+
262
+ <p align="center">
263
+ <strong>
264
+ &copy; The Lupaxa Project.
265
+ </strong>
266
+ <br />
267
+ <em>
268
+ Where exploration meets precision.<br />
269
+ Where the untamed meets the engineered.
270
+ </em>
271
+ </p>
272
+
@@ -0,0 +1,233 @@
1
+ <!-- markdownlint-disable -->
2
+ <p align="center">
3
+ <a href="https://github.com/lupaxa-security-toolbox">
4
+ <img src="https://raw.githubusercontent.com/the-lupaxa-project/org-logos/master/orgs/security-toolbox/readme-logo.png" alt="Project Logo" width="256"/><br/>
5
+ </a>
6
+ The Lupaxa Security Toolbox.<br />
7
+ Part of The Lupaxa Project.
8
+ </p>
9
+
10
+ # lupaxa-certtool
11
+
12
+ A clean, modern, fully-typed Python CLI and library for generating **self-signed X.509 certificates**, **certificate signing requests (CSRs)**, and **private keys**.
13
+
14
+ Built for automation, reproducibility, and bulk-generation workflows used by The Lupaxa Project.
15
+
16
+ ## Features
17
+
18
+ - Generate **self-signed certificates**, **private keys**, and **CSRs**
19
+ - Generate from:
20
+ - **JSON config file**
21
+ - **Directory of config files** (bulk mode)
22
+ - **Pure command-line flags**
23
+ - Output:
24
+ - To **stdout**
25
+ - Or into an **output directory**, with one folder per certificate
26
+ - Supports:
27
+ - RSA key generation
28
+ - SHA-256 / SHA-384 / SHA-512 digests
29
+ - Validity period configuration
30
+ - Optional **private key encryption** with passphrase
31
+ - **Subject Alternative Names (SANs)** via JSON or CLI
32
+ - Includes:
33
+ - `--generate-example` to produce a full example JSON config
34
+ - `--inspect-cert` to analyze existing PEM certificates
35
+ - `--validate-config` to validate config files before use
36
+ - Fully typed, linted, formatted, and tested
37
+ - MkDocs documentation included
38
+
39
+ ## Installation
40
+
41
+ ### From PyPI
42
+
43
+ ```bash
44
+ pip install lupaxa-certtool
45
+ ```
46
+
47
+ ### From source (development mode)
48
+
49
+ ```bash
50
+ pip install -e ".[dev]"
51
+ ```
52
+
53
+ ## Usage
54
+
55
+ ### Basic self-signed certificate from CLI
56
+
57
+ ```bash
58
+ certtool \
59
+ --countryName UK \
60
+ --stateOrProvinceName Somerset \
61
+ --localityName Glastonbury \
62
+ --organizationName "Lupaxa Project" \
63
+ --commonName "example.local"
64
+ ```
65
+
66
+ ## Using JSON Configuration
67
+
68
+ ### Generate an example config
69
+
70
+ ```bash
71
+ certtool --generate-example --example-file example-cert.json
72
+ ```
73
+
74
+ ### Use a JSON config file
75
+
76
+ ```bash
77
+ certtool --config example-cert.json
78
+ ```
79
+
80
+ ### Use a directory of configs (bulk mode)
81
+
82
+ ```bash
83
+ certtool --config-dir configs/
84
+ ```
85
+
86
+ ## Output Directory Structure
87
+
88
+ If you pass:
89
+
90
+ ```bash
91
+ certtool --config-dir configs/ --output-dir output/
92
+ ```
93
+
94
+ You get:
95
+
96
+ ```bash
97
+ output/
98
+ ├── example.local/
99
+ │ ├── cert.pem
100
+ │ ├── csr.pem
101
+ │ └── key.pem
102
+ └── api.internal/
103
+ ├── cert.pem
104
+ ├── csr.pem
105
+ └── key.pem
106
+ ```
107
+
108
+ Each certificate gets its own folder to prevent overwriting.
109
+
110
+ ## Private Key Encryption
111
+
112
+ ### JSON
113
+
114
+ ```bash
115
+ {
116
+ "passphrase": "your-secret-here"
117
+ }
118
+ ```
119
+
120
+ ### CLI (overrides JSON)
121
+
122
+ ```bash
123
+ certtool --config server.json --passphrase "some-secret"
124
+ ```
125
+
126
+ ## Inspect a Certificate
127
+
128
+ ```bash
129
+ certtool --inspect-cert output/example.local/cert.pem
130
+ ```
131
+
132
+ ## Development
133
+
134
+ ### Run tests
135
+
136
+ ```bash
137
+ make test
138
+ ```
139
+
140
+ ### Type checking
141
+
142
+ ```bash
143
+ make type
144
+ ```
145
+
146
+ ### Lint, format, and style checks
147
+
148
+ ```bash
149
+ make check-style
150
+ ```
151
+
152
+ ### Run everything
153
+
154
+ ```bash
155
+ make check-all
156
+ ```
157
+
158
+ ### Build documentation
159
+
160
+ ```bash
161
+ mkdocs serve
162
+ ```
163
+
164
+ ## Documentation
165
+
166
+ The project includes MkDocs documentation.
167
+
168
+ ### Online documentation:
169
+
170
+ [Documentation](https://lupaxa-security-toolbox.github.io/certtool/)
171
+
172
+ Full documentation is available in the docs/ directory or served locally:
173
+
174
+ ### Serve docs locally
175
+
176
+ ```bash
177
+ mkdocs serve
178
+ ```
179
+
180
+ Then open the printed URL (usually http://127.0.0.1:8000/) in your browser.
181
+
182
+ ## Development
183
+
184
+ Clone the repository and install dev dependencies:
185
+
186
+ ```bash
187
+ pip install -e ".[dev]"
188
+ ```
189
+
190
+ Useful make targets:
191
+
192
+ ```bash
193
+ make test # run tests
194
+ make type # type checking (mypy)
195
+ make check-style # lint + format + type
196
+ make check-all # run tests, coverage, and audit
197
+ ```
198
+
199
+ ## Repository Layout
200
+
201
+ ```bash
202
+ lupaxa-certtool/
203
+ ├── src/lupaxa/certtool/
204
+ │ ├── cli.py
205
+ │ ├── certs.py
206
+ │ ├── utils.py
207
+ │ ├── config.py
208
+ │ ├── example.py
209
+ │ ├── exceptions.py
210
+ │ ├── version.py
211
+ │ └── __init__.py
212
+ ├── docs/
213
+ ├── tests/
214
+ ├── mkdocs.yml
215
+ ├── Makefile
216
+ ├── pyproject.toml
217
+ ├── .editorconfig
218
+ ├── .gitignore
219
+ └── README.md
220
+ ```
221
+ <h1></h1>
222
+
223
+ <p align="center">
224
+ <strong>
225
+ &copy; The Lupaxa Project.
226
+ </strong>
227
+ <br />
228
+ <em>
229
+ Where exploration meets precision.<br />
230
+ Where the untamed meets the engineered.
231
+ </em>
232
+ </p>
233
+