How to read a .pem file in a worker
Hey, I was wondering if its possible to read a .pem file in a worker, thanks!
6 Replies
Can i save it in a R2 bucket or something?
I have a .pem file that I need to use to authenticate request to an API
So i was wondering how's the best way to storew that key
Thanks!
One mor thing, does a worker support his module?
const crypto = require('crypto');
@skye_31
i see, thanksUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
can anyone help me to translate this code to webcrypto
i cant manage to get it
@aegisdaemon you also seem to use nodejs' fs module which is not available on workers
how else could i read the file? import is not working @boywithkeyboard
you could store it in cloudflare's r2 (or any other cdn/storage) and fetch it
or you import it directly and bundle it with your code
i'd suggest reading https://developers.cloudflare.com/workers/wrangler/bundling