<s> import sys <EOL> from hashlib import md5 <EOL> from datetime import datetime <EOL> import pyme . core , pyme . constants . sig <EOL> import yaml <EOL> def getPassphrase ( hint , desc , prev_bad ) : <EOL> return "<STR_LIT>" <EOL> c = pyme . core . Context ( ) <EOL> c . set_armor ( <NUM_LIT:1> ) <EOL> c . set_passphrase_cb ( getPassphrase ) <EOL> topic = { } <EOL> topic [ '<STR_LIT:type>' ] = '<STR_LIT>' <EOL> topic [ '<STR_LIT:path>' ] = '<STR_LIT>' <EOL> topic [ '<STR_LIT:title>' ] = '<STR_LIT>' <EOL> topic [ '<STR_LIT:id>' ] = md5 ( topic [ '<STR_LIT:path>' ] + topic [ '<STR_LIT:title>' ] ) . hexdigest ( ) <EOL> topic [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> topic [ '<STR_LIT:text>' ] = None <EOL> topic [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> blob = pyme . core . Data ( yaml . dump ( topic ) ) <EOL> c . op_keylist_start ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> r = c . op_keylist_next ( ) <EOL> if not r : <EOL> print ( "<STR_LIT>" ) <EOL> sys . exit ( <NUM_LIT:1> ) <EOL> key = pyme . core . Data ( ) <EOL> c . op_export ( '<STR_LIT>' , <NUM_LIT:0> , key ) <EOL> sig = pyme . core . Data ( ) <EOL> c . signers_add ( r ) <EOL> c . op_sign ( blob , sig , pyme . constants . sig . mode . CLEAR ) <EOL> data = { } <EOL> sig . seek ( <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> data [ '<STR_LIT>' ] = sig . read ( ) <EOL> print ( yaml . dump ( data ) ) </s>
