https://github.com/erdc/dodcerts
DoD Certificate Chain
https://github.com/erdc/dodcerts
Last synced: 6 months ago
JSON representation
DoD Certificate Chain
- Host: GitHub
- URL: https://github.com/erdc/dodcerts
- Owner: erdc
- License: bsd-3-clause
- Created: 2019-02-27T15:42:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-03-11T15:34:47.000Z (over 2 years ago)
- Last Synced: 2025-09-27T19:10:16.070Z (9 months ago)
- Language: Python
- Size: 124 KB
- Stars: 4
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
===============================
dodcerts
===============================
.. image:: https://travis-ci.com/erdc/dodcerts.svg?branch=master
:target: https://travis-ci.com/erdc/dodcerts
:alt: See Build Status on Travis CI
.. image:: https://ci.appveyor.com/api/projects/status/058qfkppjlbgxqjh/branch/master?svg=true
:target: https://ci.appveyor.com/project/kajiglet/dodcerts
:alt: See Build Status on AppVeyor
.. image:: https://circleci.com/gh/erdc/dodcerts.svg?style=svg
:target: https://circleci.com/gh/erdc/dodcerts
:alt: See Build Status on CircleCI
.. image:: https://codecov.io/gh/erdc/dodcerts/branch/master/graph/badge.svg
:target: https://codecov.io/gh/erdc/dodcerts
:alt: See Coverage Status on Codecov
DoD Certificate chain
dodcerts is a simple Certificate Authority (CA) certificate Python package providing U.S. Government DoD root and intermediate certificates as a PEM bundle.
When installed, this package includes **dod-ca-certs.pem** and methods to locate it:
* Command line interface (CLI): ::
$ dodcerts
'/Users/kajiglet/Library/Caches/Python-Eggs/dodcerts-1.0-py3.6.egg/dodcerts/dod-ca-certs.pem'
* Python: ::
>>> import dodcerts
>>> dodcerts.where()
'/Users/kajiglet/Library/Caches/Python-Eggs/dodcerts-1.0-py3.6.egg/dodcerts/dod-ca-certs.pem'
The path to the PEM bundle returned by the above methods may be overloaded by setting the value of the ``DOD_CA_CERTS_PEM_PATH`` environment variable.
dodcerts also provides a method to create a new PEM bundle based on provided certificates by specifying URLs to resources or pointing at a local directory containing the certs. This method can set ``DOD_CA_CERTS_PEM_PATH`` to easily reference the result (only valid within the calling Python process and its child processes): ::
>>> import os, dodcerts
>>> os.getenv('DOD_CA_CERTS_PEM_PATH')
>>> dodcerts.where()
'/Users/kajiglet/Library/Caches/Python-Eggs/dodcerts-1.0-py3.6.egg/dodcerts/dod-ca-certs.pem'
>>> from dodcerts.create import create_pem_bundle
>>> create_pem_bundle(destination='./my_bundle.pem', urls='https://militarycac.org/maccerts/AllCerts.zip', set_env_var=True)
'/Users/kajiglet/test/my_bundle.pem'
>>> os.getenv('DOD_CA_CERTS_PEM_PATH')
'/Users/kajiglet/test/my_bundle.pem'
>>> dodcerts.where()
'/Users/kajiglet/test/my_bundle.pem'