Beispiel #1
0
def load_syndicate_public_key( config ):
   if config.has_key("syndicate_public_key"):
      # already loaded
      return config['syndicate_public_key']
   
   pubkey_name = conf.make_syndicate_pubkey_name( config['syndicate_host'], config['syndicate_port'], config['no_tls'] )
   pubkey_path = conf.object_key_path( config, 'syndicate', pubkey_name, no_suffix=True )
   
   return storage.read_public_key( pubkey_path )
Beispiel #2
0
def store_syndicate_public_key( config, syndicate_public_key, overwrite=True ):
   assert 'syndicate_host' in config
   assert 'syndicate_port' in config
   assert 'no_tls' in config 
   
   pubkey_name = conf.make_syndicate_pubkey_name( config['syndicate_host'], config['syndicate_port'], config['no_tls'] )
   pubkey_path = conf.object_key_path( config, "syndicate", pubkey_name, no_suffix=True )
   
   return storage.write_key( pubkey_path, syndicate_public_key )
Beispiel #3
0
def store_syndicate_public_key(config, syndicate_public_key, overwrite=True):
    assert 'syndicate_host' in config
    assert 'syndicate_port' in config
    assert 'no_tls' in config

    pubkey_name = conf.make_syndicate_pubkey_name(config['syndicate_host'],
                                                  config['syndicate_port'],
                                                  config['no_tls'])
    pubkey_path = conf.object_key_path(config,
                                       "syndicate",
                                       pubkey_name,
                                       no_suffix=True)

    return storage.write_key(pubkey_path, syndicate_public_key)
Beispiel #4
0
def load_syndicate_public_key(config):
    if config.has_key("syndicate_public_key"):
        # already loaded
        return config['syndicate_public_key']

    pubkey_name = conf.make_syndicate_pubkey_name(config['syndicate_host'],
                                                  config['syndicate_port'],
                                                  config['no_tls'])
    pubkey_path = conf.object_key_path(config,
                                       'syndicate',
                                       pubkey_name,
                                       no_suffix=True)

    return storage.read_public_key(pubkey_path)
Beispiel #5
0
def erase_key( config, key_type, object_id, public=False ):
   key_path = conf.object_key_path( config, key_type, object_id, public=public )
   return util_storage.secure_erase_key( key_path )
Beispiel #6
0
def store_private_key( config, key_type, object_id, key_data ):
   key_path = conf.object_key_path( config, key_type, object_id, public=False )
   return write_key( key_path, key_data )
Beispiel #7
0
def load_private_key( config, key_type, object_id ):
   key_path = conf.object_key_path( config, key_type, object_id, public=False )
   return read_private_key( key_path )
Beispiel #8
0
def load_public_key( config, key_type, object_id ):
   key_path = conf.object_key_path( config, key_type, object_id, public=True )
   return read_public_key( key_path )