@othent/kms-unbundled
Version:
Arweave Oauth Othent wallets enabled Google Key Management Service.
13 lines • 549 B
JavaScript
import { encrypt as encryptFunction } from "../operations/encrypt";
import { userDetails } from "../auth/userDetails";
/**
* Encrypt data with the users JWK. This function assumes (and requires) a user is logged in and a valid string to sign.
* @param plaintext The data in string format to sign.
* @returns The encrypted data.
*/
export async function encrypt(plaintext) {
const user = await userDetails();
const encryptedData = await encryptFunction(plaintext, user.sub);
return encryptedData;
}
//# sourceMappingURL=encrypt.js.map