def METHOD_NAME(certs_and_keys, entity, keystore_pw, ca_crt, keystore, keystorep12):
    print(f'Importing {entity} certificates into keystore, Use "{keystore_pw}" as pw.')
    for (cert, key) in certs_and_keys:
        run([
            'openssl', 'pkcs12', '-export',
            '-in', cert,
            '-inkey', key,
            '-out', keystorep12,
            '-name', splitext(cert)[0],
            '-CAfile', ca_crt,
            '-caname', 'myCA',
            '-chain',
        ])
        run([
            'keytool', '-importkeystore',
            '-deststorepass', keystore_pw,
            '-destkeypass', keystore_pw,
            '-destkeystore', keystore,
            '-srckeystore', keystorep12,
            '-srcstoretype', 'PKCS12',
            '-srcstorepass', keystore_pw,
            '-alias', splitext(cert)[0]
        ])