pkcs1 err

This commit is contained in:
2026-02-25 21:40:35 -06:00
parent f8639c9eee
commit cf16c8af49
2 changed files with 10 additions and 2 deletions
@@ -7,7 +7,11 @@ export const generateSecureValue = (content: string) => {
const hash = Password.hash(content);
// Parse the PKCS#1 PEM key into a proper KeyObject
const publicKey = crypto.createPublicKey(secureValuesPublicKey);
const publicKey = crypto.createPublicKey({
key: secureValuesPublicKey,
format: "pem",
type: "pkcs1",
});
// Encrypt the content using the .secureValues.pub public key
const encrypted = crypto.publicEncrypt(
+5 -1
View File
@@ -3,7 +3,11 @@ import crypto from "crypto";
import { secureValuesPrivateKey } from "../../constants";
import GenericError from "../../Errors/GenericError";
const privateKey = crypto.createPrivateKey(secureValuesPrivateKey);
const privateKey = crypto.createPrivateKey({
key: secureValuesPrivateKey,
format: "pem",
type: "pkcs1",
});
export const readSecureValue = (
encryptedContent: string,