a lot of things
This commit is contained in:
@@ -6,10 +6,13 @@ export const generateSecureValue = (content: string) => {
|
||||
// Generate a hash of the content
|
||||
const hash = Password.hash(content);
|
||||
|
||||
// Parse the PKCS#1 PEM key into a proper KeyObject
|
||||
const publicKey = crypto.createPublicKey(secureValuesPublicKey);
|
||||
|
||||
// Encrypt the content using the .secureValues.pub public key
|
||||
const encrypted = crypto.publicEncrypt(
|
||||
{
|
||||
key: secureValuesPublicKey,
|
||||
key: publicKey,
|
||||
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
|
||||
oaepHash: "sha256",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user