Code Monkey home page Code Monkey logo

dodcerts's Introduction

dodcerts

See Build Status on Travis CI See Build Status on AppVeyor See Build Status on CircleCI 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'

dodcerts's People

Contributors

kajiglet avatar sdc50 avatar araglu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.