Skip to content

Instantly share code, notes, and snippets.

@mgwilliams
Created December 28, 2013 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgwilliams/5ea039eb05f2ef3bc32c to your computer and use it in GitHub Desktop.
Save mgwilliams/5ea039eb05f2ef3bc32c to your computer and use it in GitHub Desktop.
# Import python libs
import logging
# Import third party libs
from M2Crypto import RSA
# Set up logger
log = logging.getLogger(__name__)
def decrypt(value):
key = RSA.load_key('{0}/minion.pem'.format(__opts__['pki_dir']))
return key.private_decrypt(value.decode('base64'), RSA.pkcs1_oaep_padding)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment