Skip to content

Instantly share code, notes, and snippets.

@flegoff
Created December 2, 2013 10:58
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 flegoff/7747922 to your computer and use it in GitHub Desktop.
Save flegoff/7747922 to your computer and use it in GitHub Desktop.
SCOR cert extraction
import ldap
con = ldap.initialize('ldap://annuaire.gip-cps.fr')
con.search_s("l=Sarthe (72),o=gip-cps,c=fr", ldap.SCOPE_SUBTREE, "cn=01.31@01.scor.rss.fr")
>>> con.search_s("l=Sarthe (72),o=gip-cps,c=fr", ldap.SCOPE_SUBTREE, "cn=01.31@01.scor.rss.fr")[0][1]['userCertificate;binary']
["0\x82\x03]0\x82\x02E\xa0\x03\x02\x01\x02\x02\x100001207290:\xd2\x17\xd6\x01\xb00\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x00051\x0b0\t\x06\x03U\x04\x06\x13\x02FR1\x100\x0e\x06\x03U\x04\n\x13\x07GIP-CPS1\x140\x12\x06\x03U\x04\x0b\x13\x0bAC-CLASSE-60\x1e\x17\r110517150547Z\x17\r170517150547Z0n1\x0b0\t\x06\x03U\x04\x06\x13\x02FR1\x100\x0e\x06\x03U\x04\n\x13\x07GIP-CPS1\x140\x12\x06\x03U\x04\x07\x14\x0bSarthe (72)1\x180\x16\x06\x03U\x04\x0b\x13\x0f3391722881000451\x1d0\x1b\x06\x03U\x04\x03\x16\x1401.31@01.scor.rss.fr0\x81\x9f0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03\x81\x8d\x000\x81\x89\x02\x81\x81\x00\xb7\xa1\xefFo\x13nE\xe0|{\xac\xa0\xf9\x81{\xcd\xef\x83W\xd7\xd4\x81NX\x1b\xb9\xa1 \x99`qf|\x84\xa3>\xc6\xd2,\xd2\xfc\x1d\xfa\xa7\xfd\x8e\xd3\x08?+\x08D\xcc\xc0\xc3\xd3\xceKd\xde#-S\x0f\x13\x9b\x878\xaf\xb4u\xe9\xddB\x90x\xc9\xc8\xe7?\xab\xa1\x18\xe5\x9a\xc6\x08\xd31}\x93\x0e\xab\xbe$O\x9f\x19\x13\x9b\xd8e<\x8b\xb5w\xcf\xe9U\xcfsX&@`l\x91\xb5\xa6[\xe8\x93,Y\xe5\xdaS\x02\x03\x01\x00\x01\xa3\x81\xb30\x81\xb00\x0e\x06\x03U\x1d\x0f\x01\x01\xff\x04\x04\x03\x02\x05\xe00\x13\x06\x03U\x1d%\x04\x0c0\n\x06\x08+\x06\x01\x05\x05\x07\x03\x040\x11\x06\t`\x86H\x01\x86\xf8B\x01\x01\x04\x04\x03\x02\x05 0\x1f\x06\x03U\x1d\x11\x04\x180\x16\x81\x1401.31@01.scor.rss.fr0\x15\x06\x03U\x1d \x04\x0e0\x0c0\n\x06\x08*\x81z\x01G\x03\x07\x070\x1d\x06\x03U\x1d\x0e\x04\x16\x04\x14\xd7\xa3\xea\xa1q1\x0cB\xac\xd1$FI3\x92 \xaf\xa0\x99\x9c0\x1f\x06\x03U\x1d#\x04\x180\x16\x80\x14\x96\x91\xf5\xb5\xf3\x98\xdf\x14\xb3p\xe7w\xa3\x1b/~&\xb6\xff\xb90\r\x06\t*\x86H\x86\xf7\r\x01\x01\x05\x05\x00\x03\x82\x01\x01\x00S\xb3Z\x97\x08\xdf\x01j\x9b\xc9O\x07T\xb7\x93\xe2\x81\x7fF\x13 \xae\x81*\x93)\x1e\\z\xcc\xec\x8ep\xc8\xbcTF,\xa9\xbceF\x9c\x06\xb3\xfe\xa0i\x7f_\xcf\xfb\xc8'\xe7\x17\x0e\t\xc7\x0cT\x1f\xf8\xd27Q\x18\x96\xfe\xbay\x0b\xb3\x9cp\xc0\x80\xc9?\x1e\xd41\x14\x95x\xaf\xaab|\xa5S\x92l\xd6\x87\xc5\x8agU\x8b|\x80\x17\x13`HI\x85\x8e\xc3\xb7\x015\xaf\x83\xc2\x1c\xd6\x8e\xb3\xb4#\x1a\xad\xfb\xa2_\xefFUF\x19\x05w\x8b\x0c\xc4\x9b/\x0e\xb0\x98\xcb\x8f\xc7\xa7\xbb\xb6\xc6\x0e0V\x93\x19u\x91!\x87\xad\x82<GG\x04\x04o\x81\xc9\x99\x0e\xf2s\xbd\xa4_\xca\x06kj\xbe\x8b\xd9\x1f'\xda\x87\x01\x8b\xdc\xa4\x93\x06\x16\xc7\xb3\x9bsu\xa7\x89\xfe\xe5\xeb\xc0\x89V\xa3\x04\xa4\x0f\xfbV\x9a\xc0\xad\n\xcdi\x96\xb7\x06\x91V\xf6\x81\x9f\x0c\xfe\x90\xc3\xdd\xd0_\t\x83\\;Ew\xcfYS\xe1h\x11\xc7\xad5\x9f\xd2\n\xd1\x0c\x18U\xf3"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment