<s> import logging <EOL> import sys <EOL> from kmip . core import enums <EOL> from kmip . demos import utils <EOL> from kmip . pie import client <EOL> from kmip . pie import objects <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> logger = utils . build_console_logger ( logging . INFO ) <EOL> parser = utils . build_cli_parser ( ) <EOL> opts , args = parser . parse_args ( sys . argv [ <NUM_LIT:1> : ] ) <EOL> config = opts . config <EOL> value = ( b'<STR_LIT>' ) <EOL> data_type = enums . SecretDataType . PASSWORD <EOL> usage_mask = [ enums . CryptographicUsageMask . VERIFY ] <EOL> name = '<STR_LIT>' <EOL> secret = objects . SecretData ( value , data_type , usage_mask , name ) <EOL> with client . ProxyKmipClient ( config = config ) as client : <EOL> try : <EOL> uid = client . register ( secret ) <EOL> logger . info ( <EOL> "<STR_LIT>" . format ( uid ) ) <EOL> except Exception as e : <EOL> logger . error ( e ) </s>
