Example #1
0
def learnKeysFromOthers(baseDir, nodeName, otherNodes):
    homeDir = ZStack.homeDirPath(baseDir, nodeName)
    verifDirPath = ZStack.verifDirPath(homeDir)
    pubDirPath = ZStack.publicDirPath(homeDir)
    for d in (homeDir, verifDirPath, pubDirPath):
        os.makedirs(d, exist_ok=True)
    for otherNode in otherNodes:
        for stack in (otherNode.nodestack, otherNode.clientstack):
            createCertsFromKeys(verifDirPath, stack.name, stack.verKey)
            createCertsFromKeys(pubDirPath, stack.name, stack.publicKey)
Example #2
0
def get_zstack_key_paths(stack_name, common_path):
    home_dir = ZStack.homeDirPath(common_path, stack_name)
    # secrets
    sigDirPath = ZStack.sigDirPath(home_dir)
    secretDirPath = ZStack.secretDirPath(home_dir)
    # public
    verifDirPath = ZStack.verifDirPath(home_dir)
    pubDirPath = ZStack.publicDirPath(home_dir)
    return dict(
        secret=(os.path.join(sigDirPath, stack_name) + '.key_secret',
                os.path.join(secretDirPath, stack_name) + '.key_secret'),
        public=(os.path.join(verifDirPath, stack_name) + '.key',
                os.path.join(pubDirPath, stack_name) + '.key'),
    )