Updated
This commit is contained in:
parent
bcb83dfea5
commit
4430d24a3e
14 changed files with 99 additions and 106 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue