Okay so I’m writing a .js script to call certain functions of a canister that require me to have certain permissions (caller must be a certain principal).
const canisterId = "rrkah-fqaaa-aaaaa-aaaaq-cai";
const host = "http://localhost:8000/";
const agent = new HttpAgent({ host });
agent.fetchRootKey();
const actor = Actor.createActor(someIDL, {
agent,
canisterId: canisterId,
});
await (actor as any).callFunctionThatOnlyOwnerCanAccess();
I have the private key of the identity. Can I import that and create an Identity object or something?