convert PKCS#1 keys to PKCS#8 at load time
This commit is contained in:
@@ -6,12 +6,8 @@ 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({
|
||||
key: secureValuesPublicKey,
|
||||
format: "pem",
|
||||
type: "pkcs1",
|
||||
});
|
||||
// Parse the PEM key into a proper KeyObject
|
||||
const publicKey = crypto.createPublicKey(secureValuesPublicKey);
|
||||
|
||||
// Encrypt the content using the .secureValues.pub public key
|
||||
const encrypted = crypto.publicEncrypt(
|
||||
|
||||
Reference in New Issue
Block a user