Skip to content

CryptoKey instances for asymmetric algorithm verifying must be of type "public" #21

@LIMPIX31

Description

@LIMPIX31

I am using the following jwt setup

export const jwt = jwtPlugin({
  name: 'jwt',
  alg: 'EdDSA',
  exp: '30m',
  schema: user,
  secret: await importJWK(
    {
      crv: 'Ed25519',
      d: 'N3cOzsFZwiIbtNiBYQP9bcbcTIdkITC8a4iRslrbW7Q',
      x: 'RjnTe-mqZcVls6SQ5CgW0X__jRaa-Quj5HBDREzVLhc',
      kty: 'OKP',
    },
    'EdDSA',
  ),
})

This works for signing, but not for verification

TypeError: CryptoKey instances for asymmetric algorithm verifying must be of type "public"

It's worth noting that @elysia/jwt is using version 4 of jose. It might be a good idea to consider upgrading to version 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions