Skip to content

Instantly share code, notes, and snippets.


Samuel Keeley keeleysam

View GitHub Profile
pudquick /
Created Jan 17, 2016
Getting an unsigned plist / mobileconfig from a signed one in python on OS X with pyObjC
import objc
from Foundation import NSBundle
Security_bundle = NSBundle.bundleWithIdentifier_('')
CMSDecoderRef = objc.createOpaquePointerType("CMSDecoderRef", b"^{CMSDecoder}", None)
functions = [('CMSDecoderCreate', b'io^^{CMSDecoder}'),
('CMSDecoderUpdateMessage', b'i^{CMSDecoder}*I'),
('CMSDecoderFinalizeMessage', b'i^{CMSDecoder}',),
pudquick /
Last active Aug 29, 2015
SHA-1 PEM cert signature & CN extraction from a certificate via python on OS X
import base64, hashlib
from ctypes import CDLL, POINTER, Structure, create_string_buffer, byref
from ctypes.util import find_library
Security = CDLL(find_library('Security'))
# Importing this via C because haven't figured out how to mix in pyObjc version yet
c_CoreFoundation = CDLL(find_library('CoreFoundation'))
class OpaqueType(Structure):
You can’t perform that action at this time.