- Timestamp:
- Jul 12, 2011 11:30:45 AM (13 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 62e8e03
- Parents:
- 816daef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/cert_to_fedid.py
r816daef r2d601b7 21 21 self.add_option('--cert', dest='cert', 22 22 help='Cretificate to copy subject from') 23 self.add_option('--cn', dest='cn', default=None, 24 help='Set the CN directly') 23 25 self.add_option('--openssl', dest='openssl', 24 26 help='Path to openssl command', default='/usr/bin/openssl') … … 42 44 43 45 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:]) 46 if opts.cn is not None: 47 subj = '/CN=' + opts.cn 48 if len(subj) > 64: subj = subj[0:63] 49 else: 50 c = X509.load_cert(opts.cert) 51 subj = c.get_subject().as_text() 52 if subj.startswith('/'): i = 1 53 else: i = 0 54 subj = '/' + re.sub('/', '\/', subj[i:]) 49 55 50 56 tf, tn = tempfile.mkstemp(suffix=".pem")
Note: See TracChangeset
for help on using the changeset viewer.