Skip to main content
Module

x/jose/index.ts>calculateJwkThumbprintUri

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Go to Latest
function calculateJwkThumbprintUri
import { calculateJwkThumbprintUri } from "https://deno.land/x/jose@v4.11.1/index.ts";

Calculates a JSON Web Key (JWK) Thumbprint URI

Examples

Usage

const thumbprintUri = await jose.calculateJwkThumbprintUri({
  kty: 'EC',
  crv: 'P-256',
  x: 'jJ6Flys3zK9jUhnOHf6G49Dyp5hah6CNP84-gY-n9eo',
  y: 'nhI6iD5eFXgBTLt_1p3aip-5VbZeMhxeFSpjfEAf7Ww',
})

console.log(thumbprint)
// 'urn:ietf:params:oauth:jwk-thumbprint:sha-256:w9eYdC6_s_tLQ8lH6PUpc0mddazaqtPgeC2IgWDiqY8'

Parameters

jwk: JWK

JSON Web Key.

optional
digestAlgorithm: "sha256" | "sha384" | "sha512"

Digest Algorithm to use for calculating the thumbprint. Default is "sha256".

Returns

Promise<string>