Changeset 0c9393e
- Timestamp:
- Jul 12, 2011 11:32:05 AM (13 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master
- Children:
- 771a277
- Parents:
- b3c4896
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/cert_to_fedid.py
rb3c4896 r0c9393e 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.