Changeset 490ee21
- Timestamp:
- Dec 23, 2010 3:30:56 PM (14 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- 0c85dce, 9e75ff8
- Parents:
- 6635dd5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/cert_to_fedid.py
r6635dd5 r490ee21 4 4 import subprocess, tempfile 5 5 import os.path 6 import re 7 8 from M2Crypto import X509 6 9 7 10 from string import join … … 16 19 self.add_option('--debug', dest='debug', action='store_true', 17 20 default=False, help='Just print command') 21 self.add_option('--cert', dest='cert', 22 help='Cretificate to copy subject from') 18 23 self.add_option('--openssl', dest='openssl', 19 24 help='Path to openssl command', default='/usr/bin/openssl') … … 37 42 38 43 try: 44 c = X509.load_cert(opts.cert) 45 subj = c.get_subject().as_text() 46 if subj.startswith('/'): i = 1 47 else: i = 0 48 subj = '/' + re.sub('/', '\/', subj[i:]) 49 39 50 tf, tn = tempfile.mkstemp(suffix=".pem") 40 51 cmd = [opts.openssl, 'req', '-new', '-nodes', '-subj', 41 '/CN=users.isi.deterlab.net', '-x509', '-days', '3650',52 subj, '-x509', '-days', '3650', 42 53 '-key', key, '-out', tn] 43 54 if opts.debug:
Note: See TracChangeset
for help on using the changeset viewer.