| 1 |
Metadata-Version: 2.4 |
| 2 |
Name: certipy |
| 3 |
Version: 0.2.3 |
| 4 |
Summary: Utility to create and sign CAs and certificates |
| 5 |
Author-email: Thomas Mendoza <[email protected]> |
| 6 |
License: BSD 3-Clause License |
| 7 |
|
| 8 |
Copyright (c) 2018, Lawrence Livermore National Security, LLC |
| 9 |
All rights reserved. |
| 10 |
|
| 11 |
Redistribution and use in source and binary forms, with or without |
| 12 |
modification, are permitted provided that the following conditions are met: |
| 13 |
|
| 14 |
* Redistributions of source code must retain the above copyright notice, this |
| 15 |
list of conditions and the following disclaimer. |
| 16 |
|
| 17 |
* Redistributions in binary form must reproduce the above copyright notice, |
| 18 |
this list of conditions and the following disclaimer in the documentation |
| 19 |
and/or other materials provided with the distribution. |
| 20 |
|
| 21 |
* Neither the name of the copyright holder nor the names of its |
| 22 |
contributors may be used to endorse or promote products derived from |
| 23 |
this software without specific prior written permission. |
| 24 |
|
| 25 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 26 |
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 27 |
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 28 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 29 |
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 30 |
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 31 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 32 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 33 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 34 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 35 |
|
| 36 |
Project-URL: Homepage, https://github.com/LLNL/certipy |
| 37 |
Keywords: pki,ssl,tls,certificates |
| 38 |
Classifier: Development Status :: 4 - Beta |
| 39 |
Classifier: Intended Audience :: Developers |
| 40 |
Classifier: Topic :: Utilities |
| 41 |
Classifier: License :: OSI Approved :: BSD License |
| 42 |
Classifier: Programming Language :: Python :: 3 |
| 43 |
Classifier: Programming Language :: Python :: 3.7 |
| 44 |
Classifier: Programming Language :: Python :: 3.8 |
| 45 |
Classifier: Programming Language :: Python :: 3.9 |
| 46 |
Classifier: Programming Language :: Python :: 3.10 |
| 47 |
Classifier: Programming Language :: Python :: 3.11 |
| 48 |
Classifier: Programming Language :: Python :: 3.12 |
| 49 |
Requires-Python: >=3.7 |
| 50 |
Description-Content-Type: text/markdown |
| 51 |
License-File: LICENSE |
| 52 |
License-File: NOTICE |
| 53 |
Requires-Dist: cryptography |
| 54 |
Provides-Extra: dev |
| 55 |
Requires-Dist: pytest; extra == "dev" |
| 56 |
Requires-Dist: flask; extra == "dev" |
| 57 |
Requires-Dist: build; extra == "dev" |
| 58 |
Requires-Dist: pre-commit; extra == "dev" |
| 59 |
Requires-Dist: ruff; extra == "dev" |
| 60 |
Requires-Dist: bump-my-version; extra == "dev" |
| 61 |
Dynamic: license-file |
| 62 |
|
| 63 |
# Certipy |
| 64 |
|
| 65 |
A simple python tool for creating certificate authorities and certificates on |
| 66 |
the fly. |
| 67 |
|
| 68 |
## Introduction |
| 69 |
|
| 70 |
Certipy was made to simplify the certificate creation process. To that end, |
| 71 |
Certipy exposes methods for creating and managing certificate authorities, |
| 72 |
certificates, signing and building trust bundles. Behind the scenes Certipy: |
| 73 |
|
| 74 |
* Manages records of all certificates it creates |
| 75 |
* External certs can be imported and managed by Certipy |
| 76 |
* Maintains signing hierarchy |
| 77 |
* Persists certificates to files with appropriate permissions |
| 78 |
|
| 79 |
## Usage |
| 80 |
|
| 81 |
### Command line |
| 82 |
|
| 83 |
Creating a certificate authority: |
| 84 |
|
| 85 |
Certipy defaults to writing certs and certipy.json into a folder called `out` |
| 86 |
in your current directory. |
| 87 |
|
| 88 |
``` |
| 89 |
$ certipy foo |
| 90 |
FILES {'ca': '', 'cert': 'out/foo/foo.crt', 'key': 'out/foo/foo.key'} |
| 91 |
IS_CA True |
| 92 |
SERIAL 0 |
| 93 |
SIGNEES None |
| 94 |
PARENT_CA |
| 95 |
``` |
| 96 |
|
| 97 |
Creating and signing a key-cert pair: |
| 98 |
|
| 99 |
``` |
| 100 |
$ certipy bar --ca-name foo |
| 101 |
FILES {'ca': 'out/foo/foo.crt', 'key': 'out/bar/bar.key', 'cert': 'out/bar/bar.crt'} |
| 102 |
IS_CA False |
| 103 |
SERIAL 0 |
| 104 |
SIGNEES None |
| 105 |
PARENT_CA foo |
| 106 |
``` |
| 107 |
|
| 108 |
Removal: |
| 109 |
|
| 110 |
``` |
| 111 |
certipy --rm bar |
| 112 |
Deleted: |
| 113 |
FILES {'ca': 'out/foo/foo.crt', 'key': 'out/bar/bar.key', 'cert': 'out/bar/bar.crt'} |
| 114 |
IS_CA False |
| 115 |
SERIAL 0 |
| 116 |
SIGNEES None |
| 117 |
PARENT_CA foo |
| 118 |
``` |
| 119 |
|
| 120 |
### Code |
| 121 |
|
| 122 |
Creating a certificate authority: |
| 123 |
|
| 124 |
``` |
| 125 |
from certipy import Certipy |
| 126 |
|
| 127 |
certipy = Certipy(store_dir='/tmp') |
| 128 |
certipy.create_ca('foo') |
| 129 |
record = certipy.store.get_record('foo') |
| 130 |
``` |
| 131 |
|
| 132 |
Creating and signing a key-cert pair: |
| 133 |
|
| 134 |
``` |
| 135 |
certipy.create_signed_pair('bar', 'foo') |
| 136 |
record = certipy.store.get_record('bar') |
| 137 |
``` |
| 138 |
|
| 139 |
Creating trust: |
| 140 |
|
| 141 |
``` |
| 142 |
certipy.create_ca_bundle('ca-bundle.crt') |
| 143 |
|
| 144 |
# or to trust specific certs only: |
| 145 |
certipy.create_ca_bundle_for_names('ca-bundle.crt', ['bar']) |
| 146 |
``` |
| 147 |
|
| 148 |
Removal: |
| 149 |
|
| 150 |
``` |
| 151 |
record = certipy.remove_files('bar') |
| 152 |
``` |
| 153 |
|
| 154 |
Records are dicts with the following structure: |
| 155 |
|
| 156 |
``` |
| 157 |
{ |
| 158 |
'serial': 0, |
| 159 |
'is_ca': true, |
| 160 |
'parent_ca': 'ca_name', |
| 161 |
'signees': { |
| 162 |
'signee_name': 1 |
| 163 |
}, |
| 164 |
'files': { |
| 165 |
'key': 'path/to/key.key', |
| 166 |
'cert': 'path/to/cert.crt', |
| 167 |
'ca': 'path/to/ca.crt', |
| 168 |
} |
| 169 |
} |
| 170 |
``` |
| 171 |
|
| 172 |
The `signees` will be empty for non-CA certificates. The `signees` field |
| 173 |
is stored as a python `Counter`. These relationships are used to build trust |
| 174 |
bundles. |
| 175 |
|
| 176 |
Information in Certipy is generally passed around as records which point to |
| 177 |
actual files. For most `_record` methods, there are generally equivalent |
| 178 |
`_file` methods that operate on files themselves. The former will only affect |
| 179 |
records in Certipy's store and the latter will affect both (something happens |
| 180 |
to the file, the record for it should change, too). |
| 181 |
|
| 182 |
### Release |
| 183 |
|
| 184 |
Certipy is released under BSD license. For more details see the LICENSE file. |
| 185 |
|
| 186 |
LLNL-CODE-754897 |