def METHOD_NAME(out_dir, keystore_pw):
    ca_key = join(out_dir, 'rootCA.key')
    ca_crt = join(out_dir, 'rootCA.crt')
    print(f'Generating rootCA key: {ca_key}')
    print(f'Generating rootCA certificate: {ca_crt}')
    run([
        'openssl', 'req', '-x509', '-sha256', '-nodes',
        '-days', '365',
        '-subj', f'/C=AT/ST=Dummy State/L=Dummy Country/O=Dummy Company/CN=myCA',
        '-newkey', 'rsa:2048',
        '-keyout', ca_key,
        '-out', ca_crt
    ])
    certs_and_keys = generate_for(ca_key, ca_crt, out_dir, 'node', 1)
    keystore = join(out_dir, 'keystore.jks')
    keystore_p12 = join(out_dir, 'keystore.p12')
    import_into_keystores(certs_and_keys, 'node', keystore_pw, ca_crt, keystore, keystore_p12)
    # the CA certificate should also be in the keystore for the
    # node to be able to verify the client certificate
    run(['keytool', '-importcert',
         '-storepass', keystore_pw,
         '-keystore', keystore,
         '-file', ca_crt,
         '-alias', 'therootca'
    ])
    certs_and_keys = generate_for(ca_key, ca_crt, out_dir, 'client', 1)
    keystore_client = join(out_dir, 'keystore_client.jks')
    keystore_client_p12 = join(out_dir, 'keystore_client.p12')
    import_into_keystores(certs_and_keys, 'client', keystore_pw, ca_crt, keystore_client, keystore_client_p12)