Exemplo n.º 1
0
if (type == 'cert'):
    tobj = 'сертификат'
#Читаем объекты с токена
lm, stat = t1.listobjects(type, 'value')
if (stat != ''):
    print('Ошибка при listobjects')
    print(stat)
    quit()
print('Работа с listobjects: ' + type)
i = 0
for obj in lm:
    print(str(i) + '-ый ' + tobj)
    for key in obj.keys():
        print('\t' + key + ': ' + obj[key])
    i += 1
#lm, stat = t1.listobjects('cert', 'value')
#print('Работа с listobjects cert value:')
lm, stat = t1.listobjects('pubkey', 'value')
if (stat != ''):
    print('Ошибка при listobjects value')
    print(stat)
    quit()
print('Работа с listobjects pubkey value:')
i = 0
for obj in lm:
    print(str(i) + '-ый объект')
    for key in obj.keys():
        print('\t' + key + ': ' + obj[key])
    i += 1
bb, stat = t1.logout()