コード例 #1
0
def get_client_private_key(patient_id, study_id):
    """Grabs a user's private key file from s3."""
    key_pair_paths = construct_s3_key_paths(study_id, patient_id)
    try:
        key = s3_retrieve(key_pair_paths['private'], study_id, raw_path=True)
    except:
        print('Could not find key {0} in {1}'.format('private',
                                                     key_pair_paths))
        raise

    return encryption.import_RSA_key(key)
コード例 #2
0
ファイル: s3.py プロジェクト: xuancong84/beiwe-backend
def get_client_private_key(patient_id, study_id):
    """Grabs a user's private key file from s3."""
    key = s3_retrieve("keys/" + patient_id + "_private", study_id)
    return encryption.import_RSA_key(key)
コード例 #3
0
def get_client_public_key(patient_id, study_id):
    """Grabs a user's public key file from s3."""
    key_pair_paths = construct_s3_key_paths(study_id, patient_id)
    key = s3_retrieve(key_pair_paths['public'], study_id, raw_path=True)
    return encryption.import_RSA_key(key)