edgeport - v1.0.3
    Preparing search index...

    Function parseCreds

    • Parses a NATS credentials (.creds) file into its user JWT and nkey seed.

      The .creds format produced by nsc/nats bundles a -----BEGIN NATS USER JWT----- block and a -----BEGIN USER NKEY SEED----- block; JWT auth presents the JWT and proves possession by signing the server nonce with the seed.

      Parameters

      • creds: string

        The full contents of a .creds file.

      Returns { jwt: string; seed: string }

      The extracted jwt and seed strings.

      If either block is missing.

      1.0.0

      const { jwt, seed } = parseCreds(await readCreds());