OthentKMS getActivePublicKey() function

The getActivePublicKey() function returns the public key of the active user account.

Example Usage

To use the getActivePublicKey() function, import it from the @othent/kms package and call it within an asynchronous function as follows:

import { getActivePublicKey } from "@othent/kms";

const handleGetActivePublicKey = async () => {
  const res = await getActivePublicKey();
  console.log(res);
};

<aside> ⚠️ Note: A user must be logged in to an application to successfully call this function.

</aside>

Result

On successful execution, the function returns the public key of the connected user as follows:

"xIKaD7dtD6mypbMjlquh4NkBujfT8HCiSHd3H1md6cWHg0pFqspVYWJZMrYYZav3zN-MdSgz-9FMXCZW9OD0l1t5zLNUSSKmLMb1hplKPI9ws6rZpJFORFumQPKBppca_f0tlz-mqYfK136ssK8Vn_7byu9SI8G6PY0rN_HCxkGl2T9fzLa2OMi0jerCGzTO-VXR3-ic5TdsWYFAjX18fzQaM3qQii3EUTeQuwtHi_9TIbGFSbfvSQDEx9FsEpn09VJhmMkAKc-E-WUTQ9DaVMUt8xOc6w21FQgkfRgBGDQz9SyGK6z0nIlfq-N5bfab81cDBphgowEv-cX62T1HPsdcCwaWAonM21dzw6IIa24shA4x3Y0yt4_cTZ6Pwi2Z_bBIZp506nEf7vQhuz5o0yGeouWt-mkz6Qci3krzF3tKiGDAaQjLzKDi3Yhmy6korcZThQHSR6NbD5tVE5qU2llbFWHWwowBHDNNzwo8RfPg-dISh_PMlKzKT1F3TXazq9SBGfSjJ8XCw6b305gO_yCMJ7LBCe6zaOljufVwdqhgTzmW62Nr6HLsDCYQx8Xw7To-du2RH0ZgHktBa53G4F6pc1DknQSvgkRK-7Eybxo6y8AgrC2bOIfuSh6_3XetgDE6vxIwXbMwLTeyjKfuDAs9VLwUZRWSF5TeLJB78k8"

Applications can then either display this address within their UI or use it as part of other operations.