Swyftey
Swyftey3w ago

Deno 2.0 can't find .pem files even with --allow-read?

Hi. I just need Deno to read these .pem files for a crypto key. The paths are correct, I'm sure. My container throws an error claiming the .pem files don't exist, I'm not sure why. Any help is greatly appreciated, thanks!
No description
No description
1 Reply
Swyftey
SwyfteyOP3w ago
Update: I needed to use import.meta.dirname I believe, but now I am getting this error:
Fastify startup error: DataError: ASN.1 error: unknown/unsupported ASN.1 DER tag: 0x2d
tokens | at importKeyRSA (ext:deno_crypto/00_crypto.js:3747:58)
tokens | at importKeyInner (ext:deno_crypto/00_crypto.js:3585:14)
tokens | at SubtleCrypto.importKey (ext:deno_crypto/00_crypto.js:989:26)
tokens | at file:///tokens/src/Services/TokenService.ts:16:50
tokens | at eventLoopTick (ext:core/01_core.js:175:7)
Fastify startup error: DataError: ASN.1 error: unknown/unsupported ASN.1 DER tag: 0x2d
tokens | at importKeyRSA (ext:deno_crypto/00_crypto.js:3747:58)
tokens | at importKeyInner (ext:deno_crypto/00_crypto.js:3585:14)
tokens | at SubtleCrypto.importKey (ext:deno_crypto/00_crypto.js:989:26)
tokens | at file:///tokens/src/Services/TokenService.ts:16:50
tokens | at eventLoopTick (ext:core/01_core.js:175:7)
I think they needed to be .der files. That might've been it.