• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

private.key as string

New Here ,
Mar 20, 2022 Mar 20, 2022

Copy link to clipboard


Making sure this gets the correct eyes on so apologize for it beign a dupe of:

As the person in the post above, I too want to keep the API Cred info in AWS Secret Mgr where we pull them out into process.env variables when the pod starts.  But it's not letting me pass the private.key in as a string to .withPrivateKey().  I've tried stripping whitespace, removing the BEGIN/END lines, replacing newlines with "\n" in the string, et al.


I always get the following error:

2022-03-20T16:45:59.663:[INFO]: All validations successfully done. Beginning Combine Operation execution
Error: error:0909006C:PEM routines:get_name:no start line
at Sign.sign (node:internal/crypto/sig:131:29)
at Object.sign (/Users/chrisweicht/g3/adobe/node_modules/jwa/index.js:152:45)
at Object.jwsSign [as sign] (/Users/chrisweicht/g3/adobe/node_modules/jws/lib/sign-stream.js:32:24)
at Object.module.exports [as sign] (/Users/chrisweicht/g3/adobe/node_modules/jsonwebtoken/sign.js:204:16)
at /Users/chrisweicht/g3/adobe/node_modules/@adobe/pdfservices-node-sdk/src/internal/auth/jwt-authenticator.js:46:17
at new Promise (<anonymous>)
at JwtAuthenticator.getPrivateKeyPromise (/Users/chrisweicht/g3/adobe/node_modules/@adobe/pdfservices-node-sdk/src/internal/auth/jwt-authenticator.js:43:10)
at JwtAuthenticator.refreshSessionToken (/Users/chrisweicht/g3/adobe/node_modules/@adobe/pdfservices-node-sdk/src/internal/auth/jwt-authenticator.js:61:15)
at JwtAuthenticator.getSessionToken (/Users/chrisweicht/g3/adobe/node_modules/@adobe/pdfservices-node-sdk/src/internal/auth/jwt-authenticator.js:117:15)
at HttpRequest.authenticate (/Users/chrisweicht/g3/adobe/node_modules/@adobe/pdfservices-node-sdk/src/internal/http/http-request.js:153:31) {
library: 'PEM routines',
function: 'get_name',
reason: 'no start line',

A fallback would be to write out the private.key to a file via k8s/helm configuration but I would rather keep it in process.env if possible.


Thanks in advance.

General , How to , PDF Services API







Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation