Skip to content

Commit

Permalink
Update owl.js to use file system to read public and private keys
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewstech committed Jul 29, 2024
1 parent 3bdcc21 commit bb8ee8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/owl.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ async function loadKeyStore() {
const keystore = jose.JWK.createKeyStore();

// Load the public key for encryption from environment variable
const publicKey = process.env.PUBLIC_KEY;
const publicKey = fs.readFileSync('keys/public_key.pem', 'utf8');
if (!publicKey) {
throw new Error('Public key not found in environment variables');
}
await keystore.add(publicKey, 'pem');

// Load the private key for decryption from environment variable
const privateKey = process.env.PRIVATE_KEY;
const privateKey = fs.readFileSync('keys/private_key.pem', 'utf8');
if (!privateKey) {
throw new Error('Private key not found in environment variables');
}
Expand Down

0 comments on commit bb8ee8d

Please sign in to comment.