def token_to_cms(signed_text):
 copy_of_text = signed_text.replace('-', '/')
 lines = ['-----BEGIN CMS-----']
 lines += [copy_of_text[n:(n + 64)] for n in range(0, len(copy_of_text), 64)]
 lines.append('-----END CMS-----\n')
 return '\n'.join(lines)

def token_to_cms ( signed_text ) : copy_of_text = signed_text . replace ( '-' , '/' ) lines = [ '-----BEGIN CMS-----' ] lines += [ copy_of_text [ n : ( n + 64 ) ] for n in range ( 0 , len ( copy_of_text ) , 64 ) ] lines . append ( '-----END CMS-----\n' ) return '\n' . join ( lines )
convert a custom formatted token to a pem-formatted token .