This commit is contained in:
Patrick Alvin Alcala 2025-11-28 09:42:36 +08:00
parent bcb83dfea5
commit 4430d24a3e
14 changed files with 99 additions and 106 deletions

View file

@ -1,8 +1,12 @@
import { JSEncrypt } from "jsencrypt";
import { $rsaPublicKey } from "../../../configs/config.security.ts";
import * as fs from "node:fs";
import * as toml from "toml";
const config = toml.parse(
fs.readFileSync("configs/config.security.toml", "utf-8"),
);
const enc = new JSEncrypt();
const PUBLIC_KEY = $rsaPublicKey.get();
const PUBLIC_KEY = config.rsa.public_key;
export default (message: string) => {
enc.setPublicKey(PUBLIC_KEY);